水晶报告“类未注册” WPF [英] Crystal Reports "Class not registered" WPF

查看:518
本文介绍了水晶报告“类未注册” WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个闪亮的WPF(4.0)应用程序,我需要添加水晶报表。我下载并安装CR for VS2010,然后我们购买并安装了Crystal Reports 13(它有WPF CrystalReportsViewer)。



作为一个测试,我创建了一个新的 Crystal Reports WPF应用程序项目。我创建了一个报表,将其链接到我的DB(Sql Server),并预览了报表。一切都很好。



然后我将CrystalReportsViewer窗口复制到我的真实应用程序(同一个机器和框架),添加了相同的引用,并尝试运行相同的代码:

  ReportDocument _report; 
this._report = new ReportDocument();
this._report.Load(@CrystalReport1.rpt);
this.reportViewer.ViewerCore.ReportSource = _report;但是在我的真实应用程序中,它在第二行显示错误:

>

 检索CLSID 
{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B}组件的COM类工厂失败,原因如下:错误:
80040154类未注册(来自HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))。




  • 我双击并三次检查引用是相同的

  • 我已经完成了所有模糊的项目和解决方案属性。
  • 我已经为项目添加了一个新的水晶报表
  • Google说确保框架是Framework 4而不是Framework 4客户端配置文件。 Google还说确保框架是Framework 4客户端配置文件而不是框架4。



还有其他我可不可以做?我不想将我的整个项目添加到测试应用程序中!



自从版本3以来,我一直在使用Crystal Reports,而在这些版本的任何版本中,已经干净地安装,注册,构建报告,将它们添加到应用程序并部署。你会认为,在13个版本后,他们或许能够正确,或者我的不同的雇主会选择另一个报告工具!

解决方案

知道了。在配置中需要将一个解决方案从任何CPU更改为x86。


I have a shiny WPF (4.0) app that I need to add Crystal Reports to. I downloaded and installed CR for VS2010, then after that we purchased and installed Crystal Reports 13 (which has the WPF CrystalReportsViewer).

As a test, I created a new "Crystal Reports WPF Application" project in Visual Studio. I created a report, linked it to my DB (Sql Server), and previewed the report. All was well.

I then copied the CrystalReportsViewer window into my "real" app (same machine and framework), added the same references and tried to run the same code:

        ReportDocument _report;
        this._report = new ReportDocument();
        this._report.Load(@"CrystalReport1.rpt");
        this.reportViewer.ViewerCore.ReportSource = _report;

However in my "real" application it bombs out on the second line with the error:

    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)).

  • I've double and triple checked that the references are the same in both projects.
  • I've gone through all obscure project and solution properties.
  • I've added a new Crystal Report to the project so it would add the references that way instead of manually.
  • Google says "make sure the framework is Framework 4 not Framework 4 Client Profile". Google also says "make sure the framework is Framework 4 Client Profile not Framework 4". I've tried both to no avail.
  • The product is registered.

What else can I do? I don't want to add my entire project to the test app!

I've been using Crystal Reports since about version 3, and not once in ANY of those versions has it cleanly installed, registered, built reports, added them to an app and deployed. You'd think that after 13 versions they'd either be able to get it right, or my various employers would choose another reporting tool!

解决方案

Got it. One solution needed to be changed from "Any CPU" to "x86" in Configuration.

这篇关于水晶报告“类未注册” WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆