Reputation: 377
I am using RDLC reports on my web page to show some data as a local report. Everything works fine but the numbers are not formatted according to my locale culture settings (sl-SI) and I am running out of ideas how to fix the problem.
Example. I have a TextBox of value:
where “Count” is integer, and the format is:
In the code before the report is populated I set the culture:
CultureInfo cInfo = new CultureInfo(“sl-SI”, false);
Thread.CurrentThread.CurrentCulture = cInfo;
Thread.CurrentThread.CurrentUICulture = cInfo;
After this I would expect the text box value to be formatted 2.358 as required by the sl-SI culture but is 2,358.
Does anybody knows what I am doing wrong?
Thank you!
Upvotes: 1
Views: 10894
Reputation: 172230
As an addition to Cerkenvic's great answer:
If you set the report's Language
property to the following expression:
=User!Language
the RDLC engine will use the current thread's locale without you having to implement and fill a custom report parameter.
Upvotes: 0
Reputation: 377
I found the solution of this problem, and would like to shere it with the comunity:
That's all.
You can do it programmatically by setting the property "Language" to equal a report parameter having the value of the wished locale ....
Thak you ...
Upvotes: 9