Page 1 of 1

Using already existing datasource for new component

Posted: Tue Jan 15, 2013 11:49 am
by simgschw
Hi,

I want to create a new stitable and add it to an existing report.

To do this the following steps are needed:

1. Create and load Report from specified path

Code: Select all

String path = "source/report.mrt";
StiReport report = new StiReport();
report.Load(path);
2. Find component with the needed datasource

Code: Select all

StiDataBand db = report.GetComponentByName("DataBandName") as StiDataBand;
DataTable dt = db.DataSource.DataTable;
3. Generate StiTable with desired DataTable dt

4. Add generated StiTable to report

My problem begins at step 2: the desired datatable of the selected component is NULL. How can I get this datatable and process it for my new table?

thanks in advance
regards

Re: Using already existing datasource for new component

Posted: Tue Jan 15, 2013 2:39 pm
by HighAley
Hello.

There is no data in the report template. So you couldn't get it.
The DataTable property is used at rendering time. At this time it's late to add StiTable to the report.

Please, describe your problem more detailed. What are you trying to get. Do it with examples, please.
We need to see what do you have and what you want to get. Then we'll be able to help you.

Thank you.