首页 > 解决方案 > 报告的来源尚未指定

问题描述

嗨,我正在使用微软报告查看器进行报告,但是在代码之后我得到了报告来源尚未指定的错误......这是我的代码

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();

标签: c#devexpress

解决方案


推荐阅读