1000求救:ASP.NET中将CrystalReportViewer的ReprotSource设为一个ReportDocument对象时出错
根据MSDN我这样写代码(看下面),但使运行引发异常,异常信息:“无效的报表源”。
这是我的代码:
ReportDocument oRpt = new ReportDocument();
oRpt.Load("E:\\My Reports\\UserInfo.rpt");
CrystalReportViewer1.ReportSource = oRpt;
我用的Crystal Reports 版本使9.0。
我直接设置
CrystalReportViewer1.ReportSource = "E:\\My Reports\\UserInfo.rpt"
是可以运行的.但把ReportSource换成ReportDocument就不行了.
急!在线等待,哪位帮我解决了给1000分(我会在另开9个帖给分)。