无效报表文件路径 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: 无效报表文件路径源错误: 
行 36:  da.Fill(ds,"login");
行 37: // CrystalReport1 cr1 = new CrystalReport1();
行 38:  ReportDoc.SetDataSource(ds);
行 39:  crv.ReportSource=ReportDoc;
行 40:  con.Close();
 

解决方案 »

  1.   

    你用的是那种报表?
    还有你用的是c#还是VB
      

  2.   

    c# 水晶报表  用的dataset
      

  3.   

    CrystalReport1 cr1 = new CrystalReport1();
    CrystalReport1 在是不是在另一个文件夹下?
    如果是你就这样 [文件夹名].CrystalReport1 cr1 = new [文件夹名].CrystalReport1()
      

  4.   

    我创建的水晶报表文件 .rpt 为什么没有匹配的类文件 .cs
      

  5.   

    to楼上:CrystalReport1 cr1 = new CrystalReport1();已经被注释掉了。ReportDoc怎么来的?代码
      

  6.   

    你是怎么创建的?水晶报表是哪个版本?
    是否已经包含在项目中?
    如果还是不行,试着把报表文件的属性中的“自定义工具”从
    CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator
    改为
    CrystalDecisions.VSShell.CodeGen.ReportCodeGenerator
      

  7.   

    public class WebForm3 : System.Web.UI.Page
    {
    protected CrystalDecisions.Web.CrystalReportViewer crv;
    protected System.Web.UI.WebControls.Button Button1;
    protected System.Web.UI.WebControls.Button Button2;
    protected System.Web.UI.WebControls.DropDownList DropDownList1;
    protected System.Web.UI.WebControls.Label Label1;
    ReportDocument ReportDoc;
    private void Page_Load(object sender, System.EventArgs e)
    {
    ReportDoc = new ReportDocument();
    SqlConnection con = DB.myconnection();
    con.Open();
    string mycon="select * from login";
    SqlDataAdapter da=new SqlDataAdapter(mycon,con);
    DataSet1 ds=new DataSet1();
    da.Fill(ds,"login");
    CrystalReport1 cr1 = new CrystalReport1();
    ReportDoc.SetDataSource(ds);
    crv.ReportSource=ReportDoc;
    con.Close();
    // 在此处放置用户代码以初始化页面
    }
    }
      

  8.   

    CrystalReport1 cr1 = new CrystalReport1();
    这行没有用 ,因为我就没有 匹配的 .cs文件
      

  9.   

    解决了,就是因为没有.cs文件,这样改 CrystalDecisions.VSShell.CodeGen.ReportCodeGenerator
    就可以了.
    请问 lee_wei(争取做一个好农民!)  为什么要将
    CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator
    改为
    CrystalDecisions.VSShell.CodeGen.ReportCodeGenerator
    这个怎样默认设置,是不是再今后创建时 都要这样设置