我在winform制作了一個名為PredictOrderReport.rdlc的報表(其中的字段來自數據集DateSetPredictOrderReport),并使用了ReportView把這個報表添加進去了(這里顯示的數據集是DateSetPredictOrderReport)。現在在ReportView的代碼中如下面所寫,可打印出來的報表除了固定下來的內容外全是空的(固定的內容也很模糊看不清,不知道什么原因)。請高手幫忙解釋下,代碼如下:PredictOrderReportView_Load(object sender, EventArgs e)? {? this.reportViewer1.RefreshReport();? }? ?public partial class PredictOrderReportView : Form? {? private DataTable dtPredictOrderReports;? public PredictOrderReportView(DataTable dtShipmentReport)? {? InitializeComponent();? this.dtPredictOrderReports = dtShipmentReport;? LocalReport localReport = this.reportViewer1.LocalReport;? localReport.Refresh();? localReport.ReportEmbeddedResource = "Leis.View.Operation.HawbDeparture.PredictOrderReport.rdlc";? localReport.DataSources.Add(new ReportDataSource("PredictOrderReport", dtPredictOrderReports));//這里的PredictOrderReport是報表所在的程序名稱,不知道是不是寫這個還是得寫數據集DateSetPredictOrderReport;dtPredictOrderReports是有數據內容的,將他作為數據源給這個報表。這些疑問還請高手們幫忙解釋下,謝謝了!? localReport.Refresh();? PrintLable(localReport);? }? public void PrintLable(LocalReport lreport)? {? if (lreport == null) return;? ReportPrint reportPrint = new ReportPrint(lreport);? PrintController printController = new StandardPrintController();? reportPrint.PrintController = printController;? reportPrint.PageHeight = 90;? reportPrint.PageWidth = 110;? reportPrint.MarginLeft = 0.2;? try? {? reportPrint.Print(); ? ? }? catch (Exception e)? {? throw (e);? }? }
- 2 回答
- 0 關注
- 463 瀏覽
添加回答
舉報
0/150
提交
取消