0
votes

I put together a POC console app. to generate a PDF from a Crystal Report (using CrystalDecisions libraries)

It all works fine on my dev. box, but encounters an exception when executed elsewhere:

Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLay er, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or on e of its dependencies. The system cannot find the file specified.

Unhandled Exception: System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. -- -> System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDeci sions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKey Token=692fbea5521e1304' or one of its dependencies. The system cannot find the f ile specified. at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()

I believe this is caused by the absence of the Crystal Reports runtime (which is not explicitly installed).

1) Can anyone please confirm this?

2) Is there any way to get this working without installing Crystal Reports runtime on the target machine(s)?

I've read about building an installer with merge modules etc. but this is a console app and I don't want to go down that route.

Thanks in advance.

EDIT:

I checked out the DLL dependencies and this actually appears to be missing libraries API-MS-WIN-CORE-*

1

1 Answers

0
votes

You will need to distribute the runtime for Crystal Reports to work.

Another option is to write second app to generate the pdf files which you could install on a server, then each of your console apps send a request to the new server app which sends back the pdf. This would mean the crystal runtime would only be installed on one machine, and the original console app wouldn't need to worry about it.

Just for information, the crystal runtime can be downloaded from here: http://scn.sap.com/docs/DOC-7824