cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

I've created an application with Crystal Reports Engine 13.0.5 and Visual Studio 2012. The application works on my development machine (Win8 64-bit).

I would like to run my application on other computer. I've installed therefore Crystal Reports Runtime 13.0.5 from:

32 bit

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_5.zip

64-bit

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_5.zip

Application displays error message after run: "The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception".

Can you help me?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Marcin

Is the app compiled as 32 bit, 64 bit or "Any CPU"?

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

I changed to "Any CPU" and works! Thank you very much.

Former Member
0 Kudos

Hi there,

Our clients that are running 64bit machines and receiving the same error: “The type initializer for ‘CrystalDecisions.CrystalReports.Engine.ReportDocument’ threw an exception.”

My application must use project platform 86X, as I’m using  COM Interop dll files. Crystal Reports works fine for 32 bit machines, but  64 bit – fails. I cannot change my project platform to 64xt as all application will fail. Is there any other way to make SAP Crystal Report XI (support pack 6)  to work, by not changing project target platform to 64x or Any CPU?

Thanks

Sal

former_member183750
Active Contributor
0 Kudos

Hello Saly

This post concerns CR version 13. As you are using Crystal Report XI, I'd like you to create a new thread. Also, specify version of .NET and exact version of CR. CR XI is just not enough info.

Thank you for your understanding,

- Ludek

SCN Moderator

Former Member
0 Kudos

Hello Ludek,

I downloaded SAP CR version 13.0.2000.0 and exactly the same problem occurs.

My windows form application has been developed with: .NET Framework 4(64bit), Microsoft VS 2010, Crystal Report version 13.0.2000.0


The customers tried to download runtime engine 64 bit on 64 bit machines:

runtime engine version 13.0.2.469

runtime engine version  13.0.6.1027

The same error appears all the time. Only solution that helps is changing Project target platform to 64x, but as I said I cannot do that as my application uses 32 bit COM Objects that requires target platform to be 86x.

Any other solution?

Thanks in Advance

former_member183750
Active Contributor
0 Kudos

Wait a minute, I'm a bit confused now. You have an app that uses 32 bit COM, but you are deploying 64 bit CR runtime...(?). Remember, the OS "bitness" has nothing to do (well up to a point) with the "bitness" of the app. E.g.;

An app compiled as 32 bit needs 32 bit runtime

An app compiled as 64 bit needs 64 bit runtime

An app compiled as "Any CPU", well that gets a bit complicated;

On a 64 bit OS, the app will by default want to load 64 bit runtime. You can force the OS to load 32 bit runtime on a 64 bit OS when the app is compiled as "Any CPU", but then, why compile as "Any CPU"?

On a 32 bit OS, an app compiled as "Any CPU" will require 32 bit runtime.

So given the above, as long as your app is compiled as 32 bit, you need to deploy the 32 bit runtime, no matter if the OS is 64 bit or 32 bit.

If the app is compiled as "Any CPU", but uses 32 bit COM, you will have to deploy 32 bit CR runtime and force the app to use the 32 bit runtime - but like I said, compiling this app to "Any CPU" does not make any sense to me.

Compiling as 64 bit makes even less of a sense due to the 32 bit COM(?).

As I see it, the short of it is:

1) Compile the app as 32 bit

2) Deploy the 32 bit CR runtime

- Ludek

Answers (0)