【问题标题】:A data source instance has not been supplied for the data source 'DataSource1'尚未为数据源“DataSource1”提供数据源实例
【发布时间】:2014-07-21 10:31:51
【问题描述】:

以下代码可以很好地显示 rdlc 报告。但问题是 首次加载页面后出现错误没有为数据源“StudentTranscript”提供数据源实例,而数据源名称正确。

protected void btnLoad_Click(object sender, EventArgs e)
{
    List<rStudentTranscript> list = StudentManager.GetStudentTrancriptById(studentId);        
        ReportDataSource rds = new ReportDataSource("StudentTranscript", list);
        ReportViewer1.LocalReport.DataSources.Clear();
        ReportViewer1.LocalReport.DataSources.Add(rds);                                  
    }       
}

如何解决这个问题?

【问题讨论】:

    标签: asp.net visual-studio-2012 sql-server-2012 rdlc


    【解决方案1】:

    尝试添加

    ReportViewer1.LocalReport.Refresh();
    

    【讨论】:

      猜你喜欢
      • 2011-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多