报告(RDLC)的本地化/全球化 [英] Report (RDLC) Localization/Globalization

查看:216
本文介绍了报告(RDLC)的本地化/全球化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[VS2010 / ASP.NET Web窗体]

[VS2010/ASP.NET Web Forms]

在一份报告(RDLC)需提供本人的本地化/全球化两种语言(PT-BR和en-US)以下内容:
- 标签/字幕(固定文字)
- 报表查看器的UI界面(按钮和工具提示像找,接下来,previous等控制)。
- 菲尔兹格式化,根据当前文化

In a report (RDLC) I need to provide localization/globalization in two languages (pt-BR and en-US) to the following elements: - Labels/Captions (fixed text) - Report Viewer UI interface (buttons and tooltips to controls like find, next, previous, etc.). - fields formating, according to the current culture

什么是才达到这一目标的最佳方式是什么?

What is the best way to achive this?


  • 要翻译字幕固定/标签从来就找到了一些解决方案,使RDLC's XML定义的说明书翻译,使用报表文本框作为附配的LabelLocID。但它似乎很丑陋和费力的!

  • To translate the fixed captions/labels I´ve found some solutions that make a manual translation of RDLC´s XML definition, using the LabelLocID of a report TextBox as an auxiliar. But it seems very ugly and toilful!

要翻译的UI界面,从来就发现,建议使用自定义的解决方案IReportingViewerMessage <一个href=\"http://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.ireportviewermessages.aspx\">MSDN.有一些其他的解决方案,这样做自动?

To translate the UI interface, I´ve found solutions that suggest the use of a custom IReportingViewerMessage MSDN. Is there some other solution to do this automatically?

要格式的数据字段,我可以设置报表和文本框的语言属性(在RDLC),但我需要这个根据当前区域性设置。我怎么能这样做呢?

To format data fields, I can set the the language attribute of the report and textbox (in a RDLC), but I need to set this according to the current culture. How could I do this?

谢谢!

推荐答案

我曾与在文化定位饲养成功的报告,我想显示作为参数的报告。这里是基本轮廓:

I have had success with localizing reports by feeding in the culture I would like to display as a parameter to the report. Here is the basic outline:


  1. 设置报表参数的再presents c您想显示的文化$ C $。让我们把它叫做preportCulture。我设置一个静态值作为默认为EN-US

  1. Setup a report parameter that represents the culture code you want to display. Let's call it pReportCulture. I set a static value as a default for "en-US"

报告的语言设置为PARM 的值:语言=参数preportCulture.Value。这应该建立在报告中的所有文本框等的文化。

Set the Language of your report to the value of the parm : Language =Parameters!pReportCulture.Value. This should setup the culture of all textboxes etc in the report.

确保把日期或货币格式上您本地化领域。使用的ToString(C)或其他有效形式。如果你做任何自定义的文本解析你将失去从文化背景的自动定位。

Make sure to put a date or currency format on fields that you localize. Use the .toString("c") or other valid formats. If you do any custom text parsing you will lose the auto localization from the culture setting.

这应该照顾大多数本地化显示。

That should take care of most the the localization display.

这篇关于报告(RDLC)的本地化/全球化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆