Skip to Content

Getting Exception when running Crystal Reports in my Windows Service

Feb 01 at 05:17 PM


avatar image

I have developed a windows service application using Visual Studio 2015, C# and .Net 4.6. I have downloaded both the Run Time (CRforVS_redist_install_64bit_13_0_21) and and CRforVS_12_0_1. My service application with Crystal reports runs great on my development machine running Windows 7, 64bit. However I installed the application and the CRforVS_redist_install_64bit_13_0_21) on the target machine running Windows Server 2008 R2 Data Center version, 64bit, , with .Net 4.6 installed.

The application is using

CrystalDecisions.CrystalReports.Engine version 1.0.0

CrystalDecisions.Shared version 1.0.0

I am getting the following Exception when executing the following code:

ReportDocument reportDocument = new ReportDocument();

string reportPath = labelData.TemplateFileLocation;


reportDocument.PrintOptions.PrinterName = labelData.PrinterName;

reportDocument.SetDatabaseLogon("xxx", "xxx");

reportDocument.PrintToPrinter(1, false, 0, 1);

// Exception

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Don Williams
Feb 01 at 05:23 PM

Why are you using 2 versions?

Uninstall both MSI's, download and install the EXE onto your DEV PC, all others are distribution ONLY, DO NOT install them on your DEV PC.

Go here:

READ the update info for SP 21 and update your assemblies to 3500.

Install SP 22 EXE onto your DEV PC only.

Rebuild your project and search for 13.0.2000.0, if any app.config files have them listed the changed them to 13.0.3500.0

Uninstall any versions on the app server and install SP 22 32 or 64 bit MSI, depending on the platform you want your app to run on. CR runtime is for your app platform and not the OS platform.


10 |10000 characters needed characters left characters exceeded