无法在C+;中打开由JRC引擎处理的文档+;c#Windows应用程序中的堆栈

无法在C+;中打开由JRC引擎处理的文档+;c#Windows应用程序中的堆栈,c#,winforms,crystal-reports,C#,Winforms,Crystal Reports,我知道这个问题已经被问过很多次了,但是没有一个能解决我的问题。我是windows应用程序新手。我正在展示水晶报告中的一些记录。这是我的密码 ReportDocument rptDoc = new ReportDocument(); ds = new InstallationReport(); ds = PrintInstallationReport(); ds.Tables[0].Merge(ds.Tables[0]); //string AppPath = Environment.Curren

我知道这个问题已经被问过很多次了,但是没有一个能解决我的问题。我是windows应用程序新手。我正在展示水晶报告中的一些记录。这是我的密码

ReportDocument rptDoc = new ReportDocument();
ds = new InstallationReport();
ds = PrintInstallationReport();
ds.Tables[0].Merge(ds.Tables[0]);
//string AppPath = Environment.CurrentDirectory + "\\Reports\\InstallationReport.rpt";
//rptDoc.Load(AppPath);
                //rptDoc.Load(@"F:\vs10\Windows\RapidDiagnostic\RapidDiagnostic\Reports\InstallationReport.rpt");
rptDoc.Load(Application.StartupPath + "\\Reports\\InstallationReport.rpt");
rptDoc.SetDataSource(ds.Tables[0]);
crystalReportViewer1.ReportSource = rptDoc;
crystalReportViewer1.Refresh();
很好用。但当我将它安装到另一台计算机时,它不工作,并显示以下错误

加载报告失败。JRC引擎处理的文档不能在C++堆栈

中打开
我可以理解,当应用程序找不到所需的报告时,会发生此错误。但是我的代码有什么问题。请帮助大家…

其他计算机是否有权访问\\reports\\installationreport.rpt?您能将代码改为指向c:\installationreport.rpt,看看效果是否更好?另外,该文件是否已被另一台计算机打开?@Sun您的意思是,我应该将我的报告放在根文件夹中,而不是
reports
文件夹中?当我通过提供路径(如
@c:\installationreport.rpt
)直接调用报表时,它可以正常工作。但是当我使用
Application.Startup+“\\Reports\\InstallationReport.rpt”
UNC路径表示报告在网络上时失败。因此,新电脑需要访问它。这是为了测试代码并消除网络路径,以隔离问题的来源。你能从新工作站的Windows资源管理器中打开报告吗?是的,当我使用类似于
c:\installationreport.rpt的东西时,它可以正常工作。那么,你知道它不是你的代码。这与网络路径不可访问或文件已打开/正在使用有关。