Using already existing datasource for new component

Stimulsoft Reports.NET discussion
Post Reply
simgschw
Posts: 73
Joined: Mon Jan 07, 2013 1:34 pm

Using already existing datasource for new component

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Using already existing datasource for new component

Post 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.
Post Reply