How to remove comma from crystal report string and

2019-04-21 14:49发布

问题:

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.