使用水晶报告在c#windows应用程序中生成水晶报告时出错

时间:2014-01-17 17:23:51

标签: c# winforms crystal-reports setup-deployment

部署后生成水晶报告时出错。 我使用visual studio 2010

Unhandled exception has occurred in your application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit, the application will close immediately.Length cannot be less than zero.Parameter name:  length.

我在水晶报表中的代码

    private void crystalReportViewer1_Load(object sender, EventArgs e)
    {
        this.crystalReportViewer1.RefreshReport();
        rd = new ReportDocument();
        String reportpath = Application.StartupPath;
        reportpath = reportpath.Substring(0, reportpath.LastIndexOf("bin"));
        rd.Load(reportpath + "PatientReportNonReactive.rpt");
        DataSet ds = prc.nonReactiveReportNew(cond);
        rd.SetDataSource(ds.Tables[0]);
        crystalReportViewer1.ReportSource = rd;
        crystalReportViewer1.RefreshReport();
    }

0 个答案:

没有答案