C# – Use comma for decimals and period for thousands rdlc report

asp.netcdecimalrdlcreportviewer

I'm using Report Viewer Control (rdlc) to generate reports. One of my columns represent a decimal value from a SQL database, for example:

5199.9800 

and at the end of this column, all the amounts are summed. So, the amounts rows are represented this way:

 =Fields!DEBIT.Value 

And the total row is represented this way:

 =Sum(CDbl(Fields!DEBIT.Value), "dtsItems")

Currently all the values are formatted in the standard way, using comma for thousands and period for decimals like this:

  5,199.98      

but i need to format it the opposite way: using period for thousands and comma for decimals, like this:

   5.199,98 

I've been searching for a way to do it with an expression or just changing the TextBox properties in the rdlc file, but nothing seems to work.

Best Answer

Maybe try using Excel style masks? It would be something like this:

=Format(CDbl(Fields!DEBIT.Value), "#.###,##")

Or you can convert it to a string and use the all the goodness of a string.format, but you lose sorting.

Another related solution: What are the valid Style Format Strings for a Reporting Services [SSRS] Expression?