[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!
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 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.
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:
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"
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With