我在 WPF 应用程序中使用 Crystal 报表为我的订单生成报表时遇到了一个问题。
我的工作站配置是 Windows 7(旗舰版)64 位、Visual Studio 2010。
我没有安装任何 Crystal Report 引擎,但我已将所有必要的 dll 复制到我的项目中(创建一个文件夹,然后在我的项目中引用)。
但是当我单击按钮(生成报告的按钮)时,我在报告构造函数中遇到异常(不同的运行会出现不同的异常)。
主要异常说
"The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception."
当我深入研究内部异常时,我了解到这一点。
"Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.":"CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
这是我错误的截图,
我在谷歌上搜索了一下,知道我需要为 Vstudio 2010 安装 CR,但是如果我安装我的开发机器,我怎样才能让安装程序部署在客户端机器上,我不想安装 CR在所有机器中(我要部署到我的许多客户的机器上)。
我真的需要帮助来解决这个问题,我该怎么做才能解决我的问题?
非常感谢任何帮助。
最佳答案
官方文档says :
Deploying Crystal Reports for Visual Studio 2010 (CRVS2010) runtime files is mandatory in order to ensure that a project containing Crystal Reports components functions correctly.
要么遵循这些建议,要么拒绝在您的应用程序中使用 Crystal Reports 并选择其他部署符合您要求的报告引擎。
关于c# - 无法使用 SAP Crystal Report 生成报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26174770/