简体   繁体   English

ClickOnce部署中的Crystal Reports

[英]Crystal Reports in ClickOnce deployment

My application needs to print a Crystal Reports report. 我的应用程序需要打印Crystal Reports报告。 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. 它在安装了Crystal Reports的计算机上运行良好,但我没有办法强制客户端已经安装了它。

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. 我已经在各个地方读过,添加ClickOnce先决条件“SAP Crystal Reports Runtime Engine for .NET Framework”将允许在客户端上注册所需的Crystal Reports库。 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. 在客户端上安装应用程序时,它会下载运行时并安装运行时,但应用程序无法安装,说明必须在GAC中注册各种CrystalDecisions和CrystalReports程序集。

The first is CrystalDecisions.ReportAppServer.CommonObjectModel. 第一个是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. 我确实这样做了15次,从未进行过无缝安装。

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 ). 从SAP网站上按照本指南 (压缩,2.2 MB,包含Microsoft编译的HTML帮助文件, 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. 我遇到了这个问题:对于Click-Once应用程序, 无论客户端计算机的体系结构如何 ,都必须在客户端上下载并安装32位版本的Crystal Reports Runtime。 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. 我最终使用SAP网站上提供的MSI安装了32位和64位,以覆盖所有基础并使GAC错误消失。 Afterwards, everything ran smoothly. 事后,一切顺利。

Download and install the MSIs (not the executable) from here 从这里下载并安装MSI(不是可执行文件)

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. 除了使SAP Crystal Reports Runtime成为先决条件之外,还需要修改开发计算机上的product.xml文件。 This file is located in: {Program Files}\\Microsoft SDKs\\Windows\\v*.0A\\Bootstrapper\\Packages\\Crystal Reports for .NET Framework 4.0\\ 此文件位于: {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"/> 找到以下行并将其注释掉: <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>

Now, re-publish your solution and the setup should install both runtimes on 64-bit machines. 现在,重新发布您的解决方案,安装程序应该在64位计算机上安装两个运行时。

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. 从先决条件(自动)更改发布状态以排除名称中包含CrystalDecisions或BusinessObjects的任何文件。
  • 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)\\ SAP BusinessObjects \\ BootStrapper \\ Packages \\ Crystal Reports for .NET Framework 4.0

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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