SAP Knowledge Base Article - Public

1216679 - How to conditionally display a currency symbol if the value is different than zero, in Crystal Reports?

Symptom

  • How do you conditionally display a currency symbol?
  • In Crystal Rpeorts, how to display the currency symbol if the summary value is greater than zero, but not display it if the value is zero or less?

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020

Resolution

  • Create a conditional formatting formula that uses currency symbol constants.
       
    1. In Crystal Reports, open the report.
       
    2. Right-click on the field you want to format the currency symbol, and select: 'Format Field'
        
    3. Under the tab "Number",  click the button 'Customize'
       
    4. In the 'Custom Style' dialog box, select the 'Currency Symbol' tab, then click the 'X+2' button to the right of the 'Enable Currency Symbol' check box.
        
    5. Enter a formula like:

         If {Table.Field} > 0 then crFloatingCurrencySymbol else crNoCurrencySymbol
         
    6. Click the 'Save and Close' button, click 'OK' and then click 'OK' again.

      When the report is refreshed, any records with positive values will have the currency symbol appear to the left of the value.
        
  • Notes:
    • For the currency symbol to appear on the far left side of the field, instead of adjacent to first digit in the value, use the 'crFixedCurrencySymbol' constant instead of the 'crFloatingCurrencySymbol' constant in your formula.
       
    • When conditionally formatting a currency field, the 'Functions' window of the 'Format Formula Editor' includes the 'Currency Symbol Constants'. These do not appear when conditionally formatting non-currency fields or in the Formula Editor.

Keywords

currency symbol, c2014583 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020