72873

Crystal Reports “Class not registered” WPF

Question:

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)). <ul><li>I've double and triple checked that the references are the same in both projects.</li> <li>I've gone through all obscure project and solution properties.</li> <li>I've added a new Crystal Report to the project so it would add the references that way instead of manually.</li> <li>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.</li> <li>The product is registered.</li> </ul>

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!

Answer1:

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

Answer2:

Installing the standalone x64 and x86 packages solved this error for me.

Recommend

  • Error was not expected
  • Generating file with ajax and allow user to download it?
  • how to deploy WPF application having Crystal Report
  • Reading CrystalReport's Field Value Programmatically
  • Web Crystal reports produce Database logon failed
  • Pointer vs Reference difference when passing Eigen objects as arguments
  • LNK1104: cannot open file 'kernel32.lib'
  • ImportError: cannot import name Pubnub
  • Can my PDF ping my server when it is opened?
  • What causes the runtime difference in this trivial fortran code?
  • Retrieve IP address of device
  • using System.Speech.Synthesis with Windows10 universal app (XAML-C#)
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • Implicit joins and Where in Doctrine - how?
  • Android Activity.onWindowFocusChanged doesn't get called from within TabHost
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Adding elements to a huge XML file
  • How solve “Qt: Untested Windows version 10.0 detected!”
  • Loading .coffee files via a view in Rails
  • Create DicomImage from scratch using Dcmtk
  • How to define and use opencv mat of user type
  • Time complexity of a program which involves multiple variables
  • Alert pop up with LWUIT
  • Disabling Alt-F4 on a Win Forms NotifyIcon
  • Is my CUDA kernel really runs on device or is being mistekenly executed by host in emulation?
  • Running a C# exe file
  • Cassandra Data Model
  • Perl system calls when running as another user using sudo
  • SVN: Merging two branches together
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • AngularJs get employee from factory
  • Acquiring multiple attributes from .xml file in c#
  • Free memory of cv::Mat loaded using FileStorage API
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Getting Messege Twice Using IMvxMessenger
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Python/Django TangoWithDjango Models and Databases
  • java string with new operator and a literal
  • How to load view controller without button in storyboard?