Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Reports in ClickOnce deployment

My application needs to print a Crystal Reports report. It does not show a preview, just takes two parameters and shows a print dialog to set the printer. It works fine on computers that have Crystal Reports installed, but I do not have a way to enforce clients have it already installed.

I have read in various places that adding the ClickOnce prerequisite "SAP Crystal Reports Runtime Engine for .NET Framework" would allow the required Crystal Reports libraries to be registered on the client. When installing the application on the client, it does download the runtime, and installs the runtime, but the application fails to install stating that various CrystalDecisions and CrystalReports assemblies must be registered in GAC.

The first is CrystalDecisions.ReportAppServer.CommonObjectModel. If I add a reference to this in the project and redeploy, then it just gives another message about another assembly. I literally did this 15 times, and never got a seamless install.

What am I missing? I followed this guide from the SAP website (zipped, 2.2 MB, contains a Microsoft Compiled HTML Help file, crnet_dg_2010_en.chm).

like image 557
Ethan Avatar asked May 09 '13 21:05

Ethan


2 Answers

I had this problem: for Click-Once applications, you must download and install the 32-bit version of the Crystal Reports Runtime on the client regardless of the client computer's architecture. I ended up installing both the 32-bit and the 64-bit using the MSIs provided on SAP's site to cover all bases and make the GAC error to go away. Afterwards, everything ran smoothly.

Download and install the MSIs (not the executable) from here

FOR CLICK ONCE DEPLOYMENT

In addition to making SAP Crystal Reports Runtime a prerequisite, you need to modify the product.xml file on the development machine. This file is located in: {Program Files}\Microsoft SDKs\Windows\v*.0A\Bootstrapper\Packages\Crystal Reports for .NET Framework 4.0\

Find the following line and comment it out: <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>

Now, re-publish your solution and the setup should install both runtimes on 64-bit machines.

like image 138
Ally Avatar answered Sep 18 '22 01:09

Ally


If the above solution didn't work try this,

  • Go into your project Properties.
  • Go to the Publish tab.
  • Click the Application Files button.
  • Change Publish Status from Prerequisites(auto) to Exclude any file with CrystalDecisions or BusinessObjects in the name.
  • Click OK
  • Rebuild your application, then republish it to your site or file share to be installed by your clients.
like image 28
Rashad Valliyengal Avatar answered Sep 21 '22 01:09

Rashad Valliyengal