Home Access 2002 Reports Learn About Report Sections   |   Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Learn About Report Sections

You usually use a report in Access when you want to produce a hard copy (paper) of database records. You can create a report from scratch in Design View, or you can quickly build one using the Report Wizard.

There is one problem with using the wizard: You don’t get to go "under the hood” to learn how a report actually works. You’re like an architect who’s designed a building without knowing how to read blueprints. If at some point you want to modify or tweak the report, it’s hard to know where to start.

In that light, an understanding of report sections is crucial. In this tutorial, we’ll show you how each section of a report works as you tweak a wizard-generated report.

 Review The Tables

Open the Northwind.mdb in the Samples subfolder of your Microsoft Office folder. Assuming you have made a copy (or have a backup) of the Northwind database, open the file.

In the Database window, click Tables. Double-click the Order Details icon to open it. Review the table, noting the fields and the kind of information they contain. Close the table.

Let’s say you needed a report of all the order detail records, grouped by their OrderID. You’d also like to know the average quantity of each order. In the Database window, select Order Details. From the Insert menu, click Report. Select Report Wizard and click OK.

In the first dialog box, click the double-arrow button to move all the fields from Available Fields to Selected Fields. Click Next. The scheme at the right of the wizard shows that the records will be grouped by OrderID; click Next. Click the Summary Options button near the bottom of the wizard. Put a check in the Avg box for Quantity by clicking it; select the Detail And Summary option button. Click OK and click Next.

Select the Stepped layout and Portrait orientation if they’re not already selected and click Next. Choose the Corporate Style and click Next. At the top of the wizard, replace the default title by typing Smart Computing Order Details. Click Finish.

 Compare Sections

Review the report you created in Print Preview and click the View button to see the report in Design View. All of the text you saw in Print Preview has an underlying control, placed in a specific section, that generates that information. The section in which the control is placed determines where the text appears and how frequently.

The top section is the Report Header, which prints only once at the beginning of the report. It is usually used for the report title. The label in this section is Smart Computing Order Details. Click View to see this title at the top of page 1; click View again to return to Design View.

The next section is the Page Header, which prints once at the top of each page. This section is usually used for column headings. In your report, this section contains labels for the five fields in the Order Details table. Click View to see the Order ID, Product, Unit Price, Quantity, and Discount labels at the top of the page in Print Preview. Click View.

The next section is the group header; in this case, it’s the OrderID Header. Controls in a group header print at the beginning of each group. In your report, the control in this section displays OrderID values from the underlying table. Click View to see that, at the beginning of each group, there are OrderIDs 10248, 10249, etc. Click View.

Next is the Details section. This section usually generates the values from the underlying tables for the fields that are not grouped. In your report, these fields are ProductID, UnitPrice, Quantity, and Discount. Click View to see this data under each OrderID in each group. Click View.

 The Footers

After the headers and detail sections come the footers. While the headers tend to introduce data, the footers are likely to summarize it.

The next section is the group footer for OrderIDs. Click View to see the data in the report first because that will make it easier to match the data to the underlying control.

Beneath the records for any group are summary data with three elements: (1) the name of the group and the number of detail records included (such as "Summary for ‘OrderID’ = 10248 (3 detail records); (2) the label Avg for average; and (3) the numerical average (such as 9). Click View and you will see the three controls in the OrderID Footer that generate this text.

The Page Footer prints at the bottom of the page. It often shows the date and page number. In your report, you see two controls. The one on the left has the Now expression, which generates the date, and the control on the right creates the page number. Click View and scroll to the bottom of the page to see this information for Page 1. Click View.

Finally, there is the Report Footer. It appears once at the end of the report, usually summarizing data from the entire report. The Report Footer is empty.

 Tweak The Report

Now that you have a good idea which controls in which sections generate which data, let’s tweak the report a bit. First, suppose you decide you would prefer that the report title not be italicized Orin bold. Click View and click the Smart Computing Order Details control in the Report Header to select it. On the Formatting Toolbar, click the I and B buttons to remove the italics and bolding. Click View to see the change in Print Preview.

Second, note that in the summary data for each group, the label Avgis rather far away from the actual number. Click View. In the Group ID Footer section, select the Avg control. Press and hold the right arrow key until it reaches the 3” mark on the horizontal ruler. Click View to see the change.

Save your changes. If you’d like to delete the report, select it from the Report tab of the Database Window. Press DELETE and confirm the deletion.