This document demonstrates how to add a calculated field to a report.
The main purpose of calculated fields is to perform pre-calculations (of
virtually any level of complexity) over data fields. To learn
how to easily perform simple calculations within a single data field, refer to Add Totals to a Report.
In the Report Designer, a calculated field is similar to an ordinary data
field (e.g. you can bind controls to it, and groups, sort your report
against it).
To add a calculated field to your report, follow the instructions below.
To create a calculated field, on the ribbon click on the 'Calculations' button. When the "CalculationField Collection Editor" window comes forward click on the ADD button.
On the PROPERTIES side change the Data Member drop down to your desired datasource which is usually the same name as the report such as CONTACT. Among
these properties, make sure to change the Field Type property to an
appropriate value.
Now, let's create an expression for the calculated field.
Click the ellipsis button in the Expression section, to invoke the
Expression Editor. 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.
Finally, drag the calculated field from the Field List onto the required band just like an
ordinary data field.
The report with a calculated field is now ready. Switch to the Page Layout tab, and view
the result.