0
我有一个使用reportViewer
的C#应用程序。我想在一个reportViewer
中添加3个报告。这里是一个报表代码:无法将数据源绑定到reportViewer
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();
}
然而,当我跑我的申请,我得到以下错误
的数据源实例尚未为数据源“数据集1”
提供
可能的错误是什么?
'平等' 的列也许它http://stackoverflow.com/questions/8802707/setting-the-datasource-for-a-local-report-net-report-viewer帮助你找到答案 – 2013-03-16 19:09:50
rds的名称必须m使用RDLC中的DataSource – 2013-03-16 19:12:21