Reputation: 1062
I have a C# application that uses a reportViewer
. I want to add 3 reports in a single reportViewer
. Here is the code for a single report:
ReportDataSource rds = new ReportDataSource();
this.reportViewer1.LocalReport.DataSources.Clear();
if (comboBoxReports.SelectedIndex == 0)
{
reportViewer1.Reset();
reportViewer1.LocalReport.ReportPath = "D:\\AMOS\\WindowsFormsApplication1\\WindowsFormsApplication1\\Report2.rdlc";
rds.Name = "First_Year_IT_AttendanceBindingSource";
rds.Value = this.First_Year_IT_AttendanceBindingSource;
reportViewer1.LocalReport.DataSources.Add(rds);
this.reportViewer1.RefreshReport();
}
However when I run my application, I get the following error
A data source instance has not been supplied for the data source 'DataSet1'
What can be the possible mistake?
Upvotes: 0
Views: 2917
Reputation: 2493
Check that the columns (fields) in rdlc is 'equal' to columns in your data source
Upvotes: 2