Conditionally Change a Label's Text

In this tutorial, you will learn how to change a label's text if a certain condition is met, without using scripts.

To conditionally change a label's text, do the following.

  1. Create a new report and bind it to a data source.

  2. Now, add a new calculated field. Field List panel, click a data table and click Add calculated field button.

  3. Click the Edit button (the 'pencil' icon ) Field Type property to String.

    Then, click the ellipsis button for its Expression property and in the invoked Expression Editor, Iif([UnitsOnOrder] == 0, 'None', [UnitsOnOrder]), UnitsOnOrder data field's value is equal to 0, None).

  4. Finally, drop the required data fields (and the created calculated field as well) from the Field List onto the report's Detail band.

The report is now ready. Switch your report to the Preview mode and view the result.