Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Report (RDLC) Localization/Globalization

[VS2010/ASP.NET Web Forms]

Hi,

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?

  • 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!

  • 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?

  • 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?

Thanks!

like image 408
outlookrperson Avatar asked Jun 21 '11 15:06

outlookrperson


People also ask

What is difference between RDL and Rdlc?

RDL and RDLC formats have the same XML schema. However, in RDLC files, some values (such as query text) are allowed to be empty, which means that they are not immediately ready to be published to a Report Server.

What does Rdlc mean?

What is an RDLC file? The RDLC stands for Report Definition Language Client side. Actually It is an extension of report file created by using Microsoft reporting technology. The SQL Server 2005 version of Report Designer is used to create these files.


1 Answers

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. 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"

  2. 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.

  3. 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.

like image 87
Tj Kellie Avatar answered Sep 30 '22 18:09

Tj Kellie