报告在浏览器中显示空白页面

时间:2017-07-06 14:05:44

标签: c# asp.net crystal-reports

我的报告在运行时显示空白页面。数据表包含信息,但不会在页面上显示:

enter image description here

存储过程将数据提取到数据表:

enter image description here

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;

1 个答案:

答案 0 :(得分:0)

我刚刚添加了" crystalreportviewers13"这个文件夹到我的项目文件夹,它解决了这个问题。