我的报告在运行时显示空白页面。数据表包含信息,但不会在页面上显示:
存储过程将数据提取到数据表:
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;
答案 0 :(得分:0)
我刚刚添加了" crystalreportviewers13"这个文件夹到我的项目文件夹,它解决了这个问题。