Use comma for decimals and period for thousands rd

2019-07-07 00:29发布

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.

2条回答
干净又极端
2楼-- · 2019-07-07 00:45

First select object with expression, usually text box and in properties find property Format and enter this: #,0.00;(#,0.00) Somewhere below format find Language property and set to hr-HR (this is for Croatia Republic). That's all... Works for me!

查看更多
霸刀☆藐视天下
3楼-- · 2019-07-07 00:49

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?

查看更多
登录 后发表回答