Using already existing datasource for new component
Posted: Tue Jan 15, 2013 11:49 am
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
2. Find component with the needed datasource
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
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);
Code: Select all
StiDataBand db = report.GetComponentByName("DataBandName") as StiDataBand;
DataTable dt = db.DataSource.DataTable;
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