Multiple Data Table

Stimulsoft Reports.NET discussion
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Multiple Data Table

Post by fkmfkm »

I am now using this

rep.RegData(dtReport)

Can I register multiple DataTable to one SR ?

How should I do it ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Multiple Data Table

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

rep.RegData(dtReport1);
rep.RegData(dtReport2);
...
or

Code: Select all

StiReport report = new StiReport();
DataSet dSet = new DataSet();
DataTable dtReport1 = new DataTable("T1");
DataTable dtReport2 = new DataTable("T2");
dSet.Tables.Add(dtRepor1);
dSet.Tables.Add(dtRepor2);
report.RegData(dSet);
Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Multiple Data Table

Post by fkmfkm »

Thanks for your reply.

But if I have more than one DataTable how does SR knows which table is for which datasource ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Multiple Data Table

Post by Alex K. »

Hello,

Could you please explain what do you mean?

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Multiple Data Table

Post by fkmfkm »

rep.RegData(dtReport1);
rep.RegData(dtReport2);


for the code above how do we know which datatable is for which DataSource (in Stimulreport) ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Multiple Data Table

Post by Alex K. »

Hello,

The full syntax of the method:
report.RegData(string NameInDataStore, string AliasInDataStore, connection)

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Multiple Data Table

Post by fkmfkm »

Where is this NameInDataStore and AliasInDataStore from ?

is it from the dialog where i create New Data Source ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Multiple Data Table

Post by Alex K. »

Hello,

Yes, it is from the dialog.

Thank you.
Ali Kolahdoozan
Posts: 7
Joined: Sat Mar 01, 2008 10:19 am
Location: Malaysia

Multiple Data Table

Post by Ali Kolahdoozan »

Hi all



When I follow the code above , it does not show the data in the first DataTable and it counts out the first DataTable and it refuses the first one.


Regards
Ali
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Multiple Data Table

Post by Ivan »

Hello,

Can you please send us a simple test project, which reproduce the issue?

Thank you.
Post Reply