Conditionally Change a Label's Text
- Last UpdatedNov 27, 2025
- 2 minute read
To conditionally format a label's text
-
Create a new report.
-
Bind the report to a data source.
-
To create a calculated field, in the Field List, right-click any item inside the dataset, and from the menu, choose Add Calculated Field.

-
In the Property Grid, set the field's Field Type property to String.
-
Locate its Expression property and click the ellipsis.
The Expression Editor is then displayed.

In this window, define the required condition for the calculated field (for example, Iif([UnitsOnOrder] == 0, 'None', [UnitsOnOrder]), which means that if the UnitsOnOrder data field's is equal to 0, the appropriate control's text will be replaced with None).
-
To close the window, click OK.
-
Drag 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 complete.
-
Switch to the Preview tab to view the result.