Conditionally Change a Label’s Text

media_1254891659406.png

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.

media_1449121699914.png

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.

 

media_1449121740851.png

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

media_1449121760042.png

The report is now ready. Switch to the Preview Tab, and view the result.