zoukankan      html  css  js  c++  java
  • 在服务器上部署VS 2008 ReportViewer,完美支持中文

    下载:

    http://www.microsoft.com/downloads/thankyou.aspx?familyId=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&displayLang=zh-cn

    在服务器安装后便可以使用了


    //----------------------------------------------------------------------------------------------------------------------------

    Reporting Services的确是个不错的东西,特别是VS2008下更显得完美了,而且ASP.net下的ReportViewer也支持打印的功能了,上个版本是不直接支持的。
    关于如何使用RS的文章,aspnetx老大翻译的这篇文章不错。只是在部署上遇到了一些麻烦,特别是对中文支持上,下面谈谈几种解决方案。

    VS 2005下的部署实际已经很简单了。
    1.安装ReportViewer.exe,或者直接下载Microsoft Report Viewer Redistributable 2005 SP1 (完全安装) 安装。
    2.再去MS网站下载语言包(ReportViewerLP.exe),在服务器上安装就可以了。


    VS2008下ReportViewer的部署:
    1.下载Microsoft Report Viewer Redistributable 2008(2.8 MB)在服务器上安装。
    2.由于MS官方网站没有提供VS2008 ReportViewer的语言包下载,所以就只能靠自己了。
        需要两个dll:
                    Microsoft.ReportViewer.WebForms.resources.dll
                    Microsoft.ReportViewer.Common.resources.dll
            如果是Winform使用ReportViewer,则需要Microsoft.ReportViewer.WinForms.resources.dll
            这几个dll实际上是资源文件编译成的dll,然后复制到运行ReportViewer 的网站下的的bin目录,就可以了,
        或者可以加到GAC中,这样就不需要每个网站的bin下都复制这几个dll.

        关于获取这几个dll?如果安装了Vs 2008的机器上都会有的,最直接的办法就是在C:\WINDOWS\assembly下可以看到
      
        
    直接用命令: xcopy C:\WINDOWS\assembly\GAC_msil c:\GAC_MSIL /E /c
    可以复制所有GAC_msil 下的所有dll

    另一种解决方案:英文操作系统下Report Viewer控件客户端工具栏中文的解决办法
     应用这个方案可以自定义toolbar上的信息,但是需要设置当前的Culture为zh_CN
    我转贴一下代码:

    Code

    web.config:

    <system.web>
        
    <globalization uiCulture="zh-CN" culture="zh-CN"/>
    <system.web>
      <appSettings>
        
    <add key="ReportViewerMessages" value="WebReport.ReportViewerMessagesZhcn,App_Code" />
      
    </appSettings>


    附件dll下载:https://files.cnblogs.com/Fooo/ReportViewerResources.rar

  • 相关阅读:
    接口调用实现类&& 为什么Autowired定义在接口上
    getSuperclass与getGenericSuperclass区别
    Error resolving template “pages”, template might not exist or might not be accessible by any of the configured Template Resolver 或者 springboot使用thymeleaf时报html没有结束标签
    dcm4che-core导包失败! mvn pom文件导包总是失败
    使用IDEA springboot 如何通过mybatis-generator自动生成mapper dao model
    《剑指offer》第三十八题:字符串的排列
    《剑指offer》第三十七题:序列化二叉树
    《剑指offer》第三十六题:二叉搜索树与双向链表
    《剑指offer》第三十五题:复杂链表的复制
    《剑指offer》第三十四题:二叉树中和为某一值的路径
  • 原文地址:https://www.cnblogs.com/Fooo/p/1341446.html
Copyright © 2011-2022 走看看