【发布时间】:2013-12-16 19:31:36
【问题描述】:
我在报告中出现以下问题,其数据是在 win-forms .net 4 应用程序中使用 C# 动态加载的。
无法为数据集“projectDS_ObservationImages”创建 DataReader
使用数据加载报告的来源:
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Site", this._dsProjectData.Tables["Site"]));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Client", this._dsProjectData.Tables["Client"]));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Head", this.getRangedHeadersCopy(this._htExcludeHeaders)));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Obs", this.getRangedObservationsCopy(this._htExcludeObservations)));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_Images", dtProjectImages));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_PMPL", this._dtPerMeterPerLineHeaders));
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ProjectDS_ObservationImages", this._dtObervsationImages));
这是导致问题的报告中添加的最后一个数据源。
每个数据源实际上都是一个数据表。所有都是此项目中 DataSet 的成员(或已克隆模式),该数据集用作报表中的唯一 DataSet。传递的 DataTables 的名称和报表中的 Data Sets 的名称,匹配 100%。
所有其他传递给报表的数据工作,与其他6个成功传递相比,这个数据源没有什么特别之处。
处理报告时,输出中未提供任何错误。
什么可能导致 DataReader 失败?
感谢您的任何意见。
更新 ---------------------------------------------- --------------------------
重命名不起作用,手动重建 DataTable 不起作用,创建并包含具有相同数据的新 DataTable 不起作用。
将报表元素复制并粘贴到子报表中,并将子报表包括在主报表上,一切正常,相同的数据构建代码,相同的数据和相同的报表布局。
rdlc 文件会损坏吗?
【问题讨论】:
标签: c# reporting-services reportviewer rdlc