This document demonstrates how to add a calculated field to a report. The main purpose of calculated fields is to perform calculations over differentdata fields. To learn how to easily perform calculations within a single data field, refer to Add Totals to a Report.
To add a calculated field to your report, follow the instructions below.
-
To create a calculated field, in the Field List, right-click any item, and on the invoked menu, choose Add Calculated Field.
-
In the Field List, select the created field to show its properties in the Property Grid. Change the Field Typeproperty to an appropriate value.
-
Now, let's create an expression for the calculated field.
Click the ellipsis button in the Expressionsection. The Expression Editorwill appear. You can also invoke this dialog by right-clicking your calculated field within the Field List and selecting Edit Expression...
Click Fields to see the field list. Double-click field names to add them to the expression string. Use the toolbar to add operators between field names.
To close the dialog and save the expression, click OK.
-
Drag the calculated field from the Field List onto a control or a table cell.
The report with a calculated field is now ready. Switch to the Preview Tab, and view the result.
See Also