Страница 1 из 1

Multiple Datasource

Добавлено: 18 фев 2008, 23:07
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);

Multiple Datasource

Добавлено: 19 фев 2008, 04:58
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.