简体   繁体   中英

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 ).

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.

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.

I found it in this location:

C:\\Program Files (x86)\\SAP BusinessObjects\\BootStrapper\\Packages\\Crystal Reports for .NET Framework 4.0

C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\SDK\\Bootstrapper\\Packages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM