Click here to Skip to main content
15,916,702 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi Every one ,
I have Developed my crystal reports on a machine that have Sap crystal Report installed a fter i finished the creation on all my reports i moved them to another machine (that has not sap Crystal report installed) , so i get all Dll From the first machine and Added them to my project as a refrences and rebuild my project
i try to test the project it's throw the folowing exception
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.

i googled for this error for while and i found some solutions says you must download Microsoft Report Viewer 2010 , i downloaded and installed it and test again the same Error come

so the question now how can i solve this error ?
and why the report viewed with no errors on the machine that have the sap crystal report installed ?
is there is need to instal sap report or it's specific component to prevent this error to be appear once again and why ..?

i will b highly appreciated , thanks for advanced
Updated 2-Jan-12 3:07am

Share this answer
Yasser El Shazly 2-Jan-12 9:58am    
i can not understand what i shell to install , is i shell install all sap crystall report component or what i shell install...!!?
evry1falls 18-Jan-13 20:12pm    
Suggest :

Complete tutorial on how to :

Download the right version for your VB.Net

Install SAP Crystal reports

Display SAP Crystal Reports in VB.Net 2010 (Photos)
from here :
You can not just include the dll's for crystal reports and get them to work. There are a lot more dll's and registry settings that need to be installed on the computer to get crystal reports to work. You are going to have to create a setup project and include the Crystal Report Merge Modules for the specific version of crystal you are targeting.

Creating a setup project with crystal reports merge modules. This is an older article but the basic steps are the same, you just need to use the correct Crystal Reports Merge Modules for the version you are using. For license key step you will use the license key for crystal reports installed on the other machine.

Certain older versions of crystal reports are only 32-bit, with no 64-bit version available. So you may need to specifically set your application to compile to x86 for your .net application. Else you will run into errors if you try to run crystal reports in a 64-bit operating system. Also older versions like crystal reports XI you will need to find the merge modules for service pack 5 to get crystal reports to run in Vista/Windows 7.

I usually create the installer in a separate setup project then the main setup project for our application for several reasons. The crystal reports adds about 80Mb to size of the installer at least for the version we use. Since it only has to be installed once we don't want our clients to have to download a large file when everything else is like 15Mb. Which means a faster download when they want to update. Crystal reports also takes a long time to install compared to our application and we don't want support to have to spend the extra time wanting for crystal to do its thing every time. This is better for support since not all our clients have IT and are tech savy and we have to install updates on multiple computers for them over GoToMeeting or other services like that.
Share this answer
Yasser El Shazly 3-Jan-12 3:50am    
that is not a diployement it is just moving the report from a developer machine to another dev machine to connet the report With the Actual System this second machine has no Sap crystal report installed and throw this errror when i try to show the report and search for a soultion for this error on this machine that does not make me install all this M.B programm , is there is asolution for that or i shell install all sap component or there is a specific Sap component can solve that without needing to install all sap crystal report component ..? thanks
s_magus 3-Jan-12 9:31am    
What version of crystal reports did you make the report with?
What version of Visual Studio are you using?
Do you have the crystal reports feature installed with Visual Studio?
Yasser El Shazly 5-Jan-12 8:24am    
Sorry For Delaying on my repond as problems in my internet connection ,
Crystal Report Version is
I use Visual Studio 2010
and no i havent any crystal report features installed on the machine that throw the error
"The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception."
so what is feature i shell install to remove this error ?
thank you ...
s_magus 5-Jan-12 23:34pm    
You will either need to create a setup project as described above to install crystal reports on your machine or find a crystal reports distribution for the version you have. You could also install the crystal reports feature for visual studio by running the installer and choosing to add the crystal reports feature from the installer which i don't believe is I would say to install whatever version you plan to redistribute or use with your application that way you don't run into problems with your application once you actual start to deploy it, because of a wrong version of crystal is being installed that is not compatible with the version you have been testing against.
You have to include merge module instead of include DLL's.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900