Multiple Datasource

Обсуждение Stimulsoft Reports.NET
Ответить
third
Сообщения: 1
Зарегистрирован: 18 фев 2008, 22:54

Multiple Datasource

Сообщение 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
Сообщения: 930
Зарегистрирован: 09 июн 2006, 12:23

Multiple Datasource

Сообщение Edward »

Please modify your code as follows:

Код: Выделить всё

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.:

Код: Выделить всё

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

Thank you.
Ответить