【发布时间】:2012-08-26 23:33:33
【问题描述】:
我以编程方式绑定到我的水晶报表查看器,例如
DataTable orderDtSrc = GetDataFromdb(txtOrderNo.Text);
rptViewer.ReportSource = new ReportDocument();
if (orderDtSrc != null)
{
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("Design/MyReport.rpt"));
report.SetDataSource(orderDtSrc);
report.SummaryInfo.ReportTitle = "Report No-" + orderDtSrc.Rows[0]["OrderNumber"].ToString();
rptViewer.ReportSource = report;
rptViewer.DataBind();
}
所以它将获取数据抛出GetDataFromdb(txtOrderNo.Text);,它通过用户提供的订单号获取数据。
首先调用它将获取报告并毫无问题地绑定查看器,然后如果我在文本框中输入一个新的订单号,然后单击调用上一个函数的显示报告按钮,我得到了这个异常。
Value cannot be null. Parameter name: inputString
【问题讨论】:
标签: asp.net visual-studio-2010 c#-4.0 crystal-reports crystal-reports-2010