Microsoft.ReportViewer winform web 部署问题

为啥不用水晶,就不解释了。自有各的原因。

有些DLL需要自己找。我这里以VS2008为例,其他版本参考。

1.ReportViewer 核心类库

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.WinForms.dll  (winform的)

Microsoft.ReportViewer.WebForms.dll (webForm的)

Microsoft.ReportViewer.ProcessingObjectModel.dll

部署方法:

1)在webform或winform中都会引用这前两个类库,但这两个类库默认是不复制到相关目录上的。选择这个引用,设置属性窗口的复制本地为True。最后一个Microsoft.ReportViewer.ProcessingObjectModel.dll不需要在项目中引用需要自己手动复制。文件在c:\windows\assaembly目录下面。由于GAC的图形化管理界面,无法直接复制出来。只能先把整个GAC目录通过DOS命令复制到其他地方。这里给出命令 xcopy c:\windows\assembly\gac_msil d:\gac_msil /E /c

2)下载安装Microsoft Report Viewer Redistributable 2008(2.8 MB)程序部署的目标机器上安装。

2.中文化(摘自网络,本人未在webform实验,winform实验不成功)

   Microsoft.ReportViewer.WebForms.resources.dll
   Microsoft.ReportViewer.Common.resources.dll

说是对应webform与winform放到相应的目录下面。webform复制到bin目录下,winform直接复制到程序根目录下。

这两个dll获取参考Microsoft.ReportViewer.ProcessingObjectModel.dll的获取方式。我甚至把vs程序目录中的ReportViewer文件夹中的zh-CN复制到winform根目录。也不行。可能非要把这个dll注册到目标机的GAC中。

 

3.webform中的activex控件安装文件。(VS2005版本的RSTP貌似不支持web打印)

RSClientPrint.cab

在c:\Program Files\Microsoft Visual Studio 9.0\ReportViewer文件夹下。

原文地址:https://www.cnblogs.com/edzjx/p/2718226.html