Use comma for decimals and period for thousands rdlc report

假如想象 提交于 2019-12-07 16:12:24

问题


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.


回答1:


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?




回答2:


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!



来源:https://stackoverflow.com/questions/24312120/use-comma-for-decimals-and-period-for-thousands-rdlc-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!