Multiple Datasource

Stimulsoft Reports.NET discussion
Post Reply
third
Posts: 2
Joined: Tue Feb 19, 2008 1:04 am

Multiple Datasource

Post by third »

I created a report on the designer with multiple datasource and works fine. Now I'm trying to pass the datasources on the codebehind load the report but I'm only getting data from the last binded datasource. How do I fix this? Thanks.

report.RegData(dtCompany);
report.RegData(dtAddresses);
report.RegData(dtPhones);
report.RegData(dtContacts);
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Multiple Datasource

Post by Edward »

Please modify your code as follows:

Code: Select all

report.RegData("MyDataSourceNameInTheReportDictionaryFor_dtCompany",dtCompany);
report.RegData("MyDataSourceNameInTheReportDictionaryFor_dtAddresses",dtAddresses);
report.RegData("MyDataSourceNameInTheReportDictionaryFor_dtPhones",dtPhones);
report.RegData("MyDataSourceNameInTheReportDictionaryFor_dtContacts",dtContacts);
report.CacheAllData = true;
or set the name of each table before register it in the Dictionary, e.g.:

Code: Select all

dtCompany.TableName = "dtCompany"
Property CacheAllData is used when relations are present for the DataSources from different DataConnections.

Thank you.
third
Posts: 2
Joined: Tue Feb 19, 2008 1:04 am

Multiple Datasource

Post by third »

Thanks a lot!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Multiple Datasource

Post by Edward »

You are welcome.

Let us know if any help is required.

Thank you.
Post Reply