locked
Setting Language When Using ReportViewer Control RRS feed

  • Question

  • User1302892969 posted

    Hi,

    We have reports which should be used by users from different cultures. Some reports include dates. The problem is that date format is not same in different cultures. 

    So, for example short date in English should display as 8/17/2016 while short date in Croatian should be 17.8.2016 etc.

    Does anybody know how to set current culture to report when using ReportViewer control?

    I see there is rs:ParameterLanguage, but I don't know how to set it to ReportViewer?

    What is recommended way to resolve different formats of number and dates?

    Thanks!

    Wednesday, August 17, 2016 8:20 PM

Answers

  • User-2057865890 posted

    Hi BorisPazin,

    1. Setup a report parameter that represents the culture code you want to display.
    2. Set the Language of your report to the value of the parameter.
    3. Make sure to put a date or currency format on fields that you localize.

    reference:

    http://stackoverflow.com/a/6428253

    http://stackoverflow.com/a/4967108

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 28, 2016 9:29 AM

All replies

  • User-2057865890 posted

    Hi BorisPazin,

    Take a look at Set the Locale for a Report or Text Box (Reporting Services). Using the built-in field User!Language in an expression for the Language property of a report or a text box

    Best Regards,

    Chris

    Thursday, August 18, 2016 9:39 AM
  • User1302892969 posted

    Hi Chris,

    Thank you for your answer.

    Unfortunately, the article doesn't explain how to set Language property for the report when using ReportViewer control.

    I know it can be done when using URL approach, but we are creating ASP.NET web application and must use ReportViewer control.

    So, my question is how to set culture, or language when showing report in ReportViewer?

    ReportViewer control doesn't have Language property. ReportViewer.ServerReport also doesn't have Language property.

    Thanks,
    Boris Pazin

    Thursday, August 18, 2016 10:20 AM
  • User-2057865890 posted

    Hi BorisPazin,

    1. Setup a report parameter that represents the culture code you want to display.
    2. Set the Language of your report to the value of the parameter.
    3. Make sure to put a date or currency format on fields that you localize.

    reference:

    http://stackoverflow.com/a/6428253

    http://stackoverflow.com/a/4967108

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 28, 2016 9:29 AM