.NET Framework 4.0 中的水晶报表

Crystal Report in .NET Framework 4.0(.NET Framework 4.0 中的水晶报表)
本文介绍了.NET Framework 4.0 中的水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用 Visual Studio 2010.NET 3.5 中编写的 WPF 应用程序.该解决方案由 8 个项目组成 - 全部在 .NET 3.5 中编译.该应用程序使用 Crystal Report.目标操作系统是 Windows 7.

We've a WPF application written in .NET 3.5 using Visual Studio 2010. The solution consists of 8 projects - all compiled in .NET 3.5. The application uses Crystal Report. Target OS is Windows 7.

最近,由于某些 3rd 方 DLL 依赖性,启动项目.NET 4.0 中编译 - 这些 DLL 需要 .NET 4.0.在此更改并重建解决方案后,Crystal Report 抛出异常.

Recently, the startup project is compiled in .NET 4.0 due to some 3rd party DLL dependency - those DLLs require .NET 4.0. After this change and rebuilding the solution, Crystal Report is throwing exception.

问题出现在ReportClass的构造函数中.

The problem occurs at the constructor of ReportClass.

异常消息:

类型初始化器'CrystalDecisions.CrystalReports.Engine.ReportDocument' 抛出了一个例外.

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.

InnerException 的消息:

InnerException's message:

"正在检索具有 CLSID 的组件的 COM 类工厂{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} 由于以下原因而失败错误:80040154 类未注册(HRESULT 异常:0x80040154 (REGDB_E_CLASSNOTREG))."

"Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

我以前没有在 Crystal Report 工作过.这个问题的原因可能是什么?

I haven't worked in Crystal Report before. What could be the cause of this problem?

请注意,编译为 .NET 3.5 时不会出现此问题.Crystal Report用于启动项目.

Please note that this problem doesn't occur when compiled as .NET 3.5. Crystal Report is used in the startup project.

推荐答案

很有可能是X86/x64的问题.

It is likely to be X86/x64 problem.

尝试将您的应用编译为面向 86 平台.

try to compile your app to target 86 platform.

这篇关于.NET Framework 4.0 中的水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)