Conditionally Change a Label’s Text


To create a calculated field, in the Field List, right-click any item inside the created dataset, and on the invoked menu, choose Add Calculated Field.


Now, in the Property Grid, set the field’s Field Type property to String. Then, locate its Expression property and click its ellipsis button. The Expression Editor will appear.

In this dialog, define the required condition for the calculated field (e.g. Iif([UnitsOnOrder] == 0, ‘None’, [UnitsOnOrder]), which means that if the UnitsOnOrder data field’s value is equal to 0, the appropriate control’s text will be replaced with None).

To close the dialog, click OK.



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 to the Preview Tab, and view the result.