【发布时间】:2013-03-16 18:41:04
【问题描述】:
我有一个使用reportViewer 的C# 应用程序。我想在一个 reportViewer 中添加 3 个报告。以下是单个报告的代码:
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();
}
但是当我运行我的应用程序时,我收到以下错误
尚未为数据源“DataSet1”提供数据源实例
可能的错误是什么?
【问题讨论】:
-
rds 的名称必须与 RDLC 中的 DataSource 匹配
标签: c# reporting-services reportviewer