在win7旗舰版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 33rpt文件的路径正确。我不知道为什么内部异常显示:系统找不到指定的路径。
我的机器安装:
它们都是GAC中的SP1版本: 13.0.2000.0
有人能帮我解决这个问题吗?
谢谢
发布于 2011-07-13 22:15:26
您可能希望尝试在64位计算机上安装32位版本。我不知道错误是否相同,但我在运行由第三方编写的一些报告时遇到了类似的问题。安装32位运行时版本为我修复了它。
https://stackoverflow.com/questions/6617104
复制相似问题