Search code examples
crystal-reportscrystal-reports-xicrystal-reports-2010

DisplayString in Crystal Report


What if we want to use DisplayString Method in Crystal Report but we want to apply this only on the basis of some parameter value ! ? Like we will pass in parameter whether the use can see the purchase rate or not ! If not then we will print Asterisk instead of actual rate else do nothing !


Solution

  • Assumes a boolean parameter named {?hide}:

    If {?hide} Then
        Replace(Space(Len(ToText(CurrentFieldValue,"#"))), " ", "*")
    Else
        ToText(CurrentFieldValue)