Reputation: 8506
As I understood, by default, the language of report viewer is set by "CultureInfo.InstalledUICulture" (not that simple). That means, if my computer is from Brazil, then it will format numbers with Brazil's culture. Altought my data may be formatted with United States' culture, so my report viewer display things incorrectly. I guess one solution to solve it, is by changing the language of the report viewer as the same of my CultureInfo.CurrentUICulture.
How can I achieve that in the simplest way, please?
Upvotes: 1
Views: 4875
Reputation: 139
There are two (+1) separate things here:
The language of the controls, tooltips, etc. inside the ReportViewer control. This depends on the System.Threading.Thread.CurrentThread.CurrentUICulture
.
The number, date, currency, etc. formats within the report. These are controlled by changing the Language
property of the rdlc file in use.
The actual content of the report which is controlled via your DataSource(s). This one is pretty obvious, but I mentioned it for sake of completeness.
Upvotes: 0
Reputation: 1349
In the report properties set the Language property as:
=System.Threading.Thread.CurrentThread.CurrentUICulture.ToString()
Or to whatever you need. I'm using a report parameter for example. The value must resolve to a string.
You can access the report properties via the properties window, and then from the top list select "Report". Or you could simply click in the gray area of the report, and press F4.
.
Upvotes: 4