Link to home
Create AccountLog in
Avatar of mech engr
mech engr

asked on

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

Hi All,

I am getting error " The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception " while loading crystal reports in windows forms application . it is working fine in DEV environment and on some client machines no issues loading reports. But on some machines it is trowing error whole loading crystal report and then application crashes. This is happening with fresh installation on client machines(both 32-bit/64-bit) and application that is already running and which used to load crystal reports fine.Please kindly help.

I am using visual studio 2002 and Crystal reports 10

NA
Avatar of Mike McCracken
Mike McCracken

How is the application compiled?
Is it for 32 bit/64 bit/Any CPU?

This link from MSDN indicates to target x86 (32-bit)
Crystal is a 32-bit application so you should compile for that.

https://social.msdn.microsoft.com/Forums/es-ES/f134b4a6-b40a-4064-8ca7-3f3058c20965/the-type-initializer-for-crystaldecisionscrystalreportsenginereportdocument-threw-an-exception?forum=vscrystalreports

mlmcc
Avatar of mech engr

ASKER

Hi mlmcc,

thanks for your kind response. how do you check platform settings in VS 2002 . I know in 2005 you can check in project properties. I don't see that option in VS 2002.

NA.
I don't know.  I am not a .net programmer.

If I recall correctly, VS2002 was probably 32-bit only so there may not be a setting for it.

mlmcc
I think VS2002 is for 32 bit only . application is not working on some 32 bit and some 64 bit machines.
I Could not find the registry value CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} from the below error , this is common across all machine s that is throwing error . Is it licensing issue or am i missing some package to install? its related to Crystal reports version 10.0



System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} failed due to the following error: 80040154.
   at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
Are you installing the CR 10 runtime files or msi?

mlmcc
mlmcc,

This is the error i am getting while loading crystal report in winfows form.

NA
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
i need version 10 and i can't find anywhere to download. I have downloaded 13 version of CR but it did not work.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account