Reports - Creating calculations in a report

Calculations can be made in a report using fields in the underlying table.   For example, one can Count a field, Sum a field or find the Maximum, etc. based on data in the report.

To create a calculation

In the following exercise the aim is to have a calculation at the end of the report indicating the number of firms in the report, and the number of firms with telephones, see the illustration below.

tool11.jpg (39129 bytes)

Display the report in Design view. Make sure the Toolbox is visible. To open the Toolbox, on the menu bar click on View, then Toolbox.

tool2.jpg (75223 bytes)

On the Toolbar, click on the Text box icon.   Make the Report Footer area wide by clicking on the grey Report Footer bar, and pulling it down. Create an unbound textbox in the Report Footer area, and position it where you want the calculated field to appear.

tool12.jpg (53753 bytes)

Rename the words Text13 with the words Number of firms.

 tool3.jpg (46029 bytes)

If the area in the Report Footer is too narrow pull it wider.  Add another unbound textbox with the caption Number of telephones.  

To do the calculation, in the expression box type in the required calculation, being sure to use the = sign, the correct brackets, and the field you want to use.

tool4.jpg (128350 bytes)

Colour is used in reports to enhance information.  A box could be drawn around the calculations, see below.

tool6.jpg (72068 bytes)

tool7.jpg (50079 bytes)

The box can be given a shading.

tool8.jpg (36497 bytes) tool9.jpg (34209 bytes)

The shaded box can be sent to the back.

tool10.jpg (46238 bytes)

The attractive clear calculation is found at the end of the report.

tool11.jpg (39129 bytes)

You can use the following expressions in reports:

Expression Description
=Sum([Number]) Calculates the sum of the number field
=Avg([Mark]) Calculates the average mark
=Count([Email addresses]) Counts the number of email addresses
=Min([Mark]) Determines the lowest mark
=Max([Mark]) Determines the highest mark
=[Page] The current page number
=Date() Gives today's date

This work may be freely copied for non-commercial use only. Copyright © Pam Miller.