【问题标题】:Crystal Reports for VS2010 in Windows 7 Pro - Load report failedWindows 7 Pro 中 VS2010 的 Crystal Reports - 加载报告失败
【发布时间】:2011-07-13 22:15:26
【问题描述】:

在 win7 Ultimate x32 中一切正常,但我无法在 win7 pro x64 中将相同的代码用于 VS2010 的 CR。

我的代码:

        ReportDocument doc = null;
        try
        {
            doc = new ReportDocument();
            doc.Load("D:\\CrystalReport4.rpt");
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
        finally
        {
            if (doc != null)
            {
                doc.Close();
                doc.Dispose();
            }
        }

总是抛出异常:

CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException: The system cannot find the path specified.

   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
   at CrystalReportsApplication1.Form1.button1_Click(Object sender, EventArgs e) in J:\Projects\CrystalReportsApplication1\CrystalReportsApplication1\Form1.cs:line 33

rpt 文件的路径正确。我不知道为什么内部异常显示:系统找不到指定的路径。

我的机器安装:
- SAP Crystal Reports,Visual Studio 2010 版
- SAP Crystal Reports,.Net Framework 4(64 位)的运行时引擎
都是SP1,GAC版本:13.0.2000.0

谁能帮我解决这个问题?
谢谢

【问题讨论】:

    标签: crystal-reports


    【解决方案1】:

    您可能想尝试在 64 位计算机上安装 32 位版本。我不知道错误是否相同,但我在运行一些由第三方编写的报告时遇到了类似的问题。安装 32 位运行时版本为我修复了它。

    【讨论】:

      猜你喜欢
      • 2013-05-02
      • 2012-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多