|
Re: Embedding a datasource in the rptdesign file? [message #758098 is a reply to message #757719] |
Mon, 21 November 2011 21:16 |
|
Are you writing out a rptdocument? It has the data in it. You could
use a data extraction task in the report engine api to extracts data
from report items like charts and tables.
Jason
On 11/21/2011 5:57 AM, js wrote:
> I have a rptdesign file with some xml and csv datasources that I store
> to disk after the content has been previewed by a user.
>
> I need to read this file in another report application with the same
> datasources and values. It could be nice if it was possible to read the
> rptdesign file and the datasources were embedded in the file. Is this
> possible or must datasources always be specified from an external resource?
|
|
|
|
Re: Embedding a datasource in the rptdesign file? [message #758310 is a reply to message #758169] |
Tue, 22 November 2011 17:04 |
|
If you do embed the chart you can always use the data extraction task to
get the chart data.
Jason
On 11/22/2011 3:48 AM, js wrote:
> I have changed my approach a bit. I first read the chart stored in a
> .chart file which has a predefined datasource/dataset (primary used to
> be able to setup colors and other ui styles).
>
> At runtime I populate the dataset using:
>
>
> public void setValues(SeriesDefinition axis, List<Float> values) {
> Double[] arr = new Double[values.size()];
> for (int i = 0; i < arr.length; i++) {
> Float val = values.get(i);
> if (val != null) {
> arr[i] = new Double(val);
> }
> }
> NumberDataSet seriesValues = NumberDataSetImpl.create(arr);
> axis.getSeries().get(0).setDataSet(seriesValues);
> }
>
>
> Then the chart is previewed/rendered using swing. I then serialize the
> chart. But when working with a .chart file I don't have a way to
> generate it to a rptdocument - unless I embed it inside a .rptdesign
> file first.
|
|
|
Powered by
FUDForum. Page generated in 0.03719 seconds