on 06-11-2014 8:10 AM
Hi,
I have a problem with formatting number fields in Crystal Reports 2011. When I have a default formatting (System Default Number Format), everything is OK, i.e. I get the result 1.23 or 1,23 depending on the locale I run the report (decimal separator changes accordingly to locale settings). The problem occurs when I need to change for example number of decimals - then the decimal separator is "hardcoded" to , (coma) and doesn't change even when the locale settings change, so what I get is always 1,234 (and should be 1.234 for English for example).
Is there any way to change this behaviour ? One suggestion I found is to use formula to retrieve separators, like:
if contentlocale="en_US" then '.' else ','
but then I would have to use it for all number fields in my report.
Can I somehow set separators programatically when calling report from Java (same as setLocale method)? Or is there any "abbreviation" for separators like in Oracle Reports (D for decimal, G for grouping - they change accordingly to locale settings)
thanks for all answers
regards
Maciej
hi Maciej,
if you want to do this in java please post your question to the forum here.
in crystal probably the best way to do this is to first create a custom function that include a case statement, taking in the locale, and then an output to a totext() format.
you could then quickly change the format of the number field by going to Format Field > Common tab and then Display String. the custom function would be called in this dialogue.
after you format one number then use the Format Painter to format the other number fields that you want to change.
-jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.