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
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
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
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.
Mike McCracken

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 started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
mech engr

ASKER
I think VS2002 is for 32 bit only . application is not working on some 32 bit and some 64 bit machines.
mech engr

ASKER
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()
Mike McCracken

Are you installing the CR 10 runtime files or msi?

mlmcc
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
mech engr

ASKER
mlmcc,

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

NA
ASKER CERTIFIED SOLUTION
Mike McCracken

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mech engr

ASKER
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
Mike McCracken

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.