Reporting Service 设置中文Bar
来源:互联网 发布:宏观经济数据公布时间 编辑:程序博客网 时间:2024/05/16 14:13
尝试了装.net2 Framework中文语言包、ReportView中文语言包、程序中采用中文属性(AssemblyInfo.cs文件中设置[assembly: NeutralResourcesLanguageAttribute("zh-CN")])、安装windows最新补丁等方法,都没有办法实现。最后在msdn看到了Microsoft.Reporting.WebForms中一个接口IReportViewerMessages的介绍:使应用程序可以提供自定义的用户界面消息。因此尝试用实现此接口的方法来实现。
在App_Code目录下新建ReportViewerMessagesZhcn.cs类,让他实现IReportViewerMessages接口,代码如下:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Reporting.WebForms;
namespace AdminConsole.App_Code
{
public class ReportViewerMessagesZhcn : IReportViewerMessages
{
#region IReportViewerMessages Members
public string BackButtonToolTip
{
get { return ("后退"); }
}
public string ChangeCredentialsText
{
get { return ("更改"); }
}
public string ChangeCredentialsToolTip
{
get { return ("ChangeCredentialsToolTip."); }
}
public string CurrentPageTextBoxToolTip
{
get { return ("当前页"); }
}
public string DocumentMap
{
get { return ("文档视图"); }
}
public string DocumentMapButtonToolTip
{
get { return ("文档视图."); }
}
public string ExportButtonText
{
get { return ("导出"); }
}
public string ExportButtonToolTip
{
get { return ("导出"); }
}
public string ExportFormatsToolTip
{
get { return ("选择格式."); }
}
public string FalseValueText
{
get { return ("不正确的值."); }
}
public string FindButtonText
{
get { return ("查找"); }
}
public string FindButtonToolTip
{
get { return ("查找"); }
}
public string FindNextButtonText
{
get { return ("下一个"); }
}
public string FindNextButtonToolTip
{
get { return ("查找下一个"); }
}
public string FirstPageButtonToolTip
{
get { return ("第一页"); }
}
public string InvalidPageNumber
{
get { return ("页面数不对"); }
}
public string LastPageButtonToolTip
{
get { return ("最后一页"); }
}
public string NextPageButtonToolTip
{
get { return ("下一页"); }
}
public string NoMoreMatches
{
get { return ("无匹配项"); }
}
public string NullCheckBoxText
{
get { return ("空值"); }
}
public string NullValueText
{
get { return ("空值"); }
}
public string PageOf
{
get { return ("页"); }
}
public string ParameterAreaButtonToolTip
{
get { return ("参数设置"); }
}
public string PasswordPrompt
{
get { return ("PasswordPrompt"); }
}
public string PreviousPageButtonToolTip
{
get { return ("上一页"); }
}
public string PrintButtonToolTip
{
get { return ("打印"); }
}
public string ProgressText
{
get { return ("正在生成报表......"); }
}
public string RefreshButtonToolTip
{
get { return ("刷新"); }
}
public string SearchTextBoxToolTip
{
get { return ("查找"); }
}
public string SelectAValue
{
get { return ("SelectAValue"); }
}
public string SelectAll
{
get { return ("全选"); }
}
public string SelectFormat
{
get { return ("选择格式"); }
}
public string TextNotFound
{
get { return ("未找到"); }
}
public string TodayIs
{
get { return ("TodayIs"); }
}
public string TrueValueText
{
get { return ("TrueValueText"); }
}
public string UserNamePrompt
{
get { return ("UserNamePrompt"); }
}
public string ViewReportButtonText
{
get { return ("查看报表"); }
}
public string ZoomControlToolTip
{
get { return ("缩放"); }
}
public string ZoomToPageWidth
{
get { return ("页宽"); }
}
public string ZoomToWholePage
{
get { return ("整页"); }
}
#endregion
}
}
最后在web.config中设置该类对ReportViewer的控制:
在 <appSettings> 节中添加 ReportViewerMessages 属性,代码如下:
<appSettings>
<add key="ReportViewerMessages" value="AdminConsole.App_Code.ReportViewerMessagesZhcn,App_Code" />
</appSettings>
编译发布,最后测试结果为工具栏显示为中文,问题得到解决。
遗留问题:导出的格式下拉框还是英文,打印对话框也是英文。
欢迎各位来交流,寻求遗留问题的解决方案。
以下为最终解决方案:
...................
<globalization fileEncoding= "utf-8" culture="zh-cn" uiCulture= "zh-cn"/>
</system.web>
- Reporting Service 设置中文Bar
- Reporting Service 设置中文Bar
- Reporting Service奇偶行不同颜色的设置
- Reporting Service
- Reporting Service
- SQLServer2005 Reporting Service 匿名登陆权限设置与访问
- 初涉Reporting Service
- Reporting Service 简易教程
- Reporting Services : Web Service
- Reporting Service 点滴
- Reporting Service 2000
- Reporting Service电子邮件订阅
- Reporting Service初体验
- 引用Reporting Service WebService
- Mvc调用Reporting Service
- Reporting Service 小技巧
- SSRS2008-Reporting Service Tips
- reporting service学习-- 配置文件
- STL vector 容器介绍
- DataGridView加序号列
- ASP.NET 2.0 Login控件使用技巧(二) - 角色管理
- 帮帮忙 ,vc++6.0引用控件的一个问题,急!!!!
- 类的成员初始化顺序
- Reporting Service 设置中文Bar
- MSMQ的简单包装类
- 我的研究体验--转浙大杨骏的研究心得(比较实在的)
- SQL嵌套查询总结 潇湘博客
- 详细说明mantis在windowsXP下的安装过程(IIS+MYSQL+PHP)
- 企业网站营销策划-第二步网站推广
- 网站推广方式大收集
- 践踏
- 不同数据库取前几个字段的方法