您的位置:首页 > 其它

在服务器上部署VS 2008 ReportViewer,完美支持中文

2008-06-12 08:53 260 查看
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。/article/4841909.html
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下可以看到

using System;

using System.Data;

using System.Configuration;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

using Microsoft.Reporting.WebForms;

namespace WebReport

<system.web>

<globalization uiCulture="zh-CN" culture="zh-CN"/>

<system.web>

<appSettings>

<add key="ReportViewerMessages" value="WebReport.ReportViewerMessagesZhcn,App_Code" />

</appSettings>

附件dll下载:/Files/jintan/ReportViewerResources.rar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: