0
當我運行它時,報告顯示空白頁面。數據表有信息,但沒有它顯示在頁面上:報告在瀏覽器中顯示空白頁面
存儲過程獲取數據到數據表:
rptDoc = new ReportDocument();
DataTable DTReport = new DataTable();
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@Number", SqlDbType.VarChar, 50);
param[0].Value = Session["PrintNumber"].ToString();
param[1] = new SqlParameter("@LOTS", SqlDbType.VarChar, 255);
param[1].Value = Lots.Trim();
DTReport = objdAccess.ExecuteSpDataTable("SPfetch", param);
CrystalReportViewer1.ID = "DeliveryNote-" + Session["PrintNumber"].ToString();
string Report = "~/Reports/Report.rpt";
rptDoc.Load(Server.MapPath(Report));
rptDoc.SetDataSource(DTReport);
rptDoc.SetParameterValue("@number", Session["PrintNumber"].ToString());
rptDoc.SetParameterValue("@LOTS", Lots.Trim());
CrystalReportViewer1.ReportSource = rptDoc;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.Visible = true;
您是否嘗試在瀏覽器/應用程序中運行之前預覽它? – Sujith