1

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:

  • =First(Fields!Count.Value, "PhoneCallsDS")

where “Count” is integer, and the format is:

  • Number
  • Use regional formatting = yes
  • Decimal places=0
  • Use 1000 separator(.)=yes

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!

2 Answers 2

9

I found the solution of this problem, and would like to shere it with the comunity:

  1. Go to the RDLC report.
  2. Click on the report field (not on the content)
  3. Go to the "Properties"
  4. Set the "Language" property to your locale (in my case "sl-SI").

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

Sign up to request clarification or add additional context in comments.

1 Comment

I setted expression for Language "=First(Fields!CultureName.Value, "QualerServiceOrder")" and got the next exception "The expression used for the language of 'body' refers to a field. Fields cannot be used in report language expressions."
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.