How to Dynamically Toggle Currency Formatting in Crystal Report -


i need ability toggle currency formatting decimal field on crystal report. in cases decimal represents percent, not want currency symbol in front of decimal. not have ability change dataset behind report or how filled. so, i'd find solution 1 crystal side.

my experience crystal engine limited so, i'd know if possible via report function. dataset behind report has boolean value (isratepercent) can used in formula determine whether or not currency symbol should displayed.

the easiest solution use conditional-formatting function associated field's display string property:

if {table.isratepercent}    totext(currentfieldvalue,"###,###.## %") else    totext(currentfieldvalue,"$###,###.##") 

another option:

if {table.isratepercent}    totext(currentfieldvalue, 2, ",", ".") + " %" else    "$" + totext(currentfieldvalue, 2, ",", ".") 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -