Using multiple datasets in RDLC

I am working on rdlc reports and the reports work very well. I was stuck when I added another dataset to the rdlc file. When adding a dataset, he also added a data source. I started the project and the report no longer worked with an error: The data source was not provided for the data source

Can someone please tell me what steps to take to use multiple datasets. I am using Visual Studio 2012.

+4
source share
2 answers

Several source data is added as follows:

ReportViewer1.LocalReport.DataSources.Add(rdS); ReportViewer1.LocalReport.DataSources.Add(rdS1); 

Follow this link:

http://www.c-sharpcorner.com/UploadFile/robo60/StandaloneRDLCReports11142007183516PM/StandaloneRDLCReports.aspx

This section covers all parts.

Also see this useful discussion:

http://forums.asp.net/t/1241964.aspx

+6
source

There should be something like this:

 ReportViewer.LocalReport.DataSources.Clear(); ReportViewer.LocalReport.DataSources.Add("DataSet_Name",DataTable); ReportViewer.LocalReport.Refresh(); 

Important Note: The dataset name must match the name that appears in rdlc. To make sure you know what it is, open rdlc in an XML editor and find out what the name of the dataset is. When you add a data source programmatically, you must refer to this name as it is specified in rdlc for sure.

0
source

All Articles