【发布时间】:2017-02-05 07:02:07
【问题描述】:
我在项目的根文件夹中有一个带有crystalreportviewer 的表单,我的水晶报表位于“报表”文件夹中。当我尝试加载我的 crystalreprot 时,它显示错误。这是我的代码...
ReportDocument rptDoc = new ReportDocument();
ds = new InstallationReport();
ds = PrintInstallationReport();
ds.Tables[0].Merge(ds.Tables[0]);
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();
它显示以下错误。
A document processed by the JRC engine cannot be opened in the C++ stack
谁能帮帮我?
【问题讨论】:
-
你能多贴一点代码吗?例如,如何初始化 rptDoc。另外,如果您能提供错误消息,那将很有帮助。
-
我认为它在 bin/debug/Reports 中查找可执行文件不是从项目根目录运行的地方
-
嗨@MikaelKoskinen 我更新了我的问题。
标签: c# winforms crystal-reports