How to remove comma from crystal report string and from integer field

杀马特。学长 韩版系。学妹 提交于 2019-12-22 03:51:10

问题


How can I remove the comma (,) from crystal report fields?

I have a field name "year" which is having a value of 2012, but when I show that value in crystal report it includes a comma, becoming 2,012.

How can I show only 2012?


回答1:


In the crystal report designer view:

Right mouse click on that field, and select Format object. Select Custom Style in the Style list, and click Customize. Untick Thousands Separator, and any other unwanted formatting.

Failing that, you could try selecting the field and deleting the "," value from the property ThousandSeperator in your properties window.




回答2:


try this for formula

ToText( ToNumber({variable1}), "#" )



回答3:


Try below code,

Replace (ToText ({Tablename.Year_Field}, 0),"," ,"" )



回答4:


I'm just guessing but I believe you have embedded your field name into another object such as a text field.

If this is the case, double click your text box in the design view, then select your text field you are having issues with. Right click and select "Text Formatting", under the Font tab click the 'Format Formula Editor' button (the one with the X-2) to the right of the Font drop down menu. Now all you have to do is close the formula editor, then cancel the Text Format window. NOW when you right click on your year field again you will have a new option to Format the field which was previously grayed out.

Alternatively, you can remove your year field from any other object it is nested in. This will give you access to all formatting options.




回答5:


NumberVar cRed; ToText (cRed,"#")

OR

ToText({some numeric field value},"#")

The "#" has to be enclosed in parenthesis, single or double.



来源:https://stackoverflow.com/questions/13472161/how-to-remove-comma-from-crystal-report-string-and-from-integer-field

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