omendra singh

hi




Re: Crystal Reports for Visual Studio The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

Mike Dole

After 6 hours of adding and removing references, hot fixes and cold showers I finally found a solution to this error...

Cause I'm as happy as a pig in sh*t I want to share it with the world (and because there really isn't anything around I found useful regarding this subject neither on the businessobjects forum nor in the newsgroups).

Errors I got:

The type initializer for "CrystalDecisions.CrystalReports.Engine.CRPE"
threw an exception.

Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50}

Things I tried:

All required dll¡¯s where present in the C:\Program Files\Common Files\Business Objects\2.7\Managed folder

Things I didn¡¯t try but found on the web :

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=642627&SiteID=1

Run C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\CRRedist\X64\ CRRedist2005_X64.msi

It worked fine yesterday

What did I do wrong, more specific what have I been up to the last 24 hours

What did the trick

Suddenly I remembered I uninstalled a 2005 project yesterday which included the CrystalDecisionsRedist2005_x86 merge module!

I re-installed the project kept my fingers crossed when the debugger hit the breakpoint at:

Private crReportDocument As New ReportDocument

And cried like a baby when I saw my splash screen!

It¡¯s strange thought that running ¡®C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\ CRRedist2005_x86.msi¡¯ didn¡¯t fix the problem..

So ¡®uninstalling a project with any kind of merge module can have these side effects¡¯

Have a good one!

Mike





Re: Crystal Reports for Visual Studio The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

msdnuser1

Mike, thanks so much for posting that! I'm so happy right now. I had everything working, and it just stopped, and I wasn't sure why. I knew I had everything setup correctly. The next time I came back to the machine, it said "System.TypeInitializationException was unhandled
Message: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception." Nothing more. The only thing that I had changed was removing the setup package.

Big thanks Mike. Rock on!




Re: Crystal Reports for Visual Studio The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

mclerget

Hi Mike, You seem to be one of the few that have actually solved this problem. I was wondering if you could be a little more specific about the solution. You mentioned the issue arose when you "uniinstalled a 2005" project. What exactly do you mean by that Did you run an Add/Remove program on the VS 2005 app that you built/installed

When you re-installed were you just running an MSI package to reinstall the program Is this what fixed it

Any help would be appreciated.





Re: Crystal Reports for Visual Studio The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

Mike Dole

As I said, I did an uninstall of a setup project don't know if I right clicked the project and uninstalled or via add / remove programs but that doesn't matter.

The thing is when you install something which includes the crystal merge modules and uninstall it later on, things get messed up because of this uninstall.

When you re-installed were you just running an MSI package to reinstall the program Is this what fixed it

Yepper..

Kind regards,

Michael





Re: Crystal Reports for Visual Studio The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

apka

I just had this problem an hour ago and was searching all over for a solution.

Worked Solution:

1. First Build your project for platform x86 (Project - Properties - Build - Target Platform - x86)

2. Then install this script (Thanks a Bunch! Mike!) on the Target machine (where you intend to run your Application):

(Because my Application was working fine on my Development Machine which had Visual Studio, Crystal Reports installed and was failing on Deployment machine which had none)

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\CRRedist2005_x86.msi

You'll notice that Business Objects were copied (C:\Program Files\Common Files\Business Objects)

and Crystal Reports for .NET Framework 2.0 (x86) in the (Control Panel - Add Remove Programs)

Not sure if your machine is a 64-bit, running

C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\CRRedist\X64\CRRedist2005_X64.msi

would fix it

Good Luck!

-ap