on 12-11-2013 3:08 PM
I am using Crystal Reports for .Net (Visual Studio 2010).
In the Display String formula, I need to strip all commas and decimals. I have tried to use:
If Not IsNull({table.field}) Then
ToText({table.field}, 0, "")
but the ToText function gives error "Too many arguments passed".
Many posts on the internet suggest trying to use a combination of Replace with the CStr function like the following:
If Not IsNull({table.field}, 0, "") Then
replace(cstr({table.field},0),',','')
but the cstr function is returning error "Too many arguments passed".
Anyone have a working function that will remove commas and decimals from a string?
Thanks...
We found a solution.
Display String function is:
Replace(Replace(CStr({table.field}), ',', ''), '.00', '')
Suppress function is:
CStr({dsMasterProblems.snomed}) = '0' Or CStr({dsMasterProblems.snomed}) = '0.00'
Thanks....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Marty,
that's good news.
before you get too far into designing your report, if exporting is a requirement for your end users with the above Display String formatting then you should know that exporting and Display String do not always get along...e.g. if you're exporting to excel then the formatting will revert to before the display string. in cases where you do need the export with the chosen format, then format within the formula like you were trying to do before.
cheers,
jamie
hi Marty,
you can use something like this...
If Not IsNull({table.field})
and isnumeric({table.field})
Then ToText(tonumber({table.field}), 0, "")
cheers,
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.