c# - 报告的来源尚未指定
问题描述
嗨,我正在使用微软报告查看器进行报告,但是在代码之后我得到了报告来源尚未指定的错误......这是我的代码
this.reportViwer1.LocalReport.DataSources.Clear(); this.purReturnReport.RefreshReport();
DMSUtilities.Reports.PurchaseReports.PurchaseDataSet pds = new PurchaseDataSet(); Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new
Microsoft.Reporting.WinForms.ReportDataSource(); reportDataSource1.Name = "DataSet1"; reportDataSource1.Value = pds.purReturnHeader;
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource2 = new
Microsoft.Reporting.WinForms.ReportDataSource(); reportDataSource2.Name = "DataSet2"; reportDataSource2.Value = pds.purReturnItemDetails;
pds.purReturnHeader.AddpurReturnHeaderRow(pRHdr.SupplierName,pRHdr.SupplierCode,pRHdr.ReturnDate,pRHdr.DocNo,pRHdr.NetAmount); if(this.purchaseReturnitems != null) { foreach(var item in this.purchaseReturnitems) { if(item.SNo != 0 && item.ItemCode != "") { pds.purReturnItemDetails.AddpurReturnItemDetailsRow(item.SNo.ToString(),item.ItemCode,item.ItemName,item.Quantity.ToString(),item.UnitPrice.ToString(),item.NetAmount.ToString(),item.AvailableQuantity.ToString()); } } } this.reportViwer1.LocalReport.DataSources.Add(reportDataSource1); this.reportViwer1.LocalReport.DataSources.Add(reportDataSource2); this.reportViwer1.RefreshReport();
解决方案
推荐阅读
- sql - 查询以将单个或动态查询中所有列的所有空值更新为不为空
- flutter - 在 iOS 上运行时 Flutter 的 Image_picker 插件会导致构建错误
- javascript - 如果周末命中,Javascript会添加天数
- reactjs - 在中间件即 redux-thunk 或 redux-saga 中运行异步代码有什么好处
- wix - 从旧 Wix 项目升级不会卸载旧实例
- escaping - 引用的 MIME 媒体类型参数是否允许转义引号?
- python - 如何在python中将第一个列表的值与第二个列表的索引匹配
- jquery - 使用 jquery 掩码添加输入
- r - 将 SingleR 标签应用于 Seurat 对象
- python - 无法在 Jupyter Notebook 中删除或获取或创建 sparkContext