Skip to main content

Conditionally Change the Label Text

This document describes how to display different values in the report control based on the specified condition.

Do the following:

  1. Select the control and click the f button to invoke the Expression Editor:

    XRLabel Expression Smart Tag Editor

  2. Specify the following expression for the Text property:

    Iif([UnitsOnOrder] == 0, 'None', [UnitsOnOrder])
    

    This expression means that if the UnitsOnOrder data field value is 0 (zero), the label’s text is set to ‘None’; otherwise, the label displays the UnitsOnOrder field value.

    Expression Editor Label text IIF

  3. Switch to Print Preview to see the result:

    Conditionally Change Label Text - Result

See Also