嗨,我正在使用微型软件报告查看器进行报告,但是在代码之后,我得到了一个错误,即未指定报告的来源...这是我的代码
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();