Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3235
  • Last Modified:

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

I just began running my development machine off Vista 64bit OS.   I have Crystal Reports XI installed (it's installed in the "Program Files (x86)" folder).  I'm developing in .net 3.5 framework.  Suddenly when i'm trying to run a page that creates a pdf using crystal reports i'm getting the following error:

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

I've tried installing the crystal reports redistributable X64 msi (because all google searches i did for the error message i was getting was telling me to do so) but it won't install.  It gives me the following error:  
"Another version of this product is already installed. installation of this version cannot continue.  to configure or remove the existing version of this product, use Add/Remove programs on the control panel".

I have no idea what to do at this point.  My questions are:

1)  Why am i getting the original error (the one about the type initializer throwing an exception"
2) is installing the redistributable the way to fix it?
3) if so, how do i get it to install
4) if not, what do i need to do to fix this problem

tearing my hair out.  I always seem to run into one problem or another with Crystal Reports.  I need to get this running ASAP so that i can finish the development of this project.

thanks for any help.
0
davidcahan
Asked:
davidcahan
  • 3
1 Solution
 
mrcoolcoderCommented:
1)  Why am i getting the original error (the one about the type initializer throwing an exception"

Make sure your web.config has a reference to the Crystal Reports Engine under assemblies.

2) is installing the redistributable the way to fix it?

No, the redistributable is intended for server that will not need the designer.  This is for a production box.

3) if so, how do i get it to install

Only way to install it will be to remove the current installation.

4) if not, what do i need to do to fix this problem

Try downloading all the Service Packs from SAP.  There are so many its confusing but there were several bugs that they fix.  You can find the location to SAP in the help.  Also, there is a strange situation that I encountered one time (I've installed Crystal on 22 production servers and workstations.  I had to grant WRITE access to the Temp folder on my system to the ASP.NET user account and the system account.
0
 
mrcoolcoderCommented:
thanks but what helped you solve your problem?
0
 
davidcahanAuthor Commented:
actually, this might sound weird, but it wasn't anything specific in your message.  It was the fact that your message influenced me to dig deeper into the problem.  What actually ended up fixing it was grabbing the dll's in C:\Program Files (x86)\Business Objects\Common\2.8\managed and placing them in my Bin folder in the project.
0
 
mrcoolcoderCommented:
Yes, that will work but the way I import assemblies is by the web.config.  Glad I could help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now