【问题标题】:Unable to bind datasource to reportViewer无法将数据源绑定到 reportViewer
【发布时间】: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”提供数据源实例

可能的错误是什么?

【问题讨论】:

标签: c# reporting-services reportviewer


【解决方案1】:
  1. 以文本形式打开 rdlc 文件
  2. DataSet1 替换为 First_Year_IT_AttendanceBindingSource

检查 rdlc 中的列(字段)是否与数据源中的列“相等”

【讨论】:

    猜你喜欢
    • 2012-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-07
    相关资源
    最近更新 更多