Home > Articles

This chapter is from the book

Report Header and Footer

In certain respects, the Report Header/Footer is similar to the Page Header/Footer. Most notably, a single command—Report Header/Footer on the View menu—toggles between hiding and unhiding both header and footer. As with the Page Header/Footer, either section can easily be eliminated by adjusting its height to 0 inches.

Unlike a page footer or header, however, a report header or footer appears only once: at the beginning and end of the report, respectively. The report header can be used for a title, the publishing entity, the date, and (perhaps) an introduction. The footer that closes the report is primarily used for summary information, such as the total of all values of particular fields.

Adding a Title to the Report Header

A Report Header often creates a cover page—that is, a full, standalone page 1. The case example at the end of the chapter builds such a page. Right now, let's just create a short title at the top of page 1.

  1. In Design view of rptAdministration, choose View Report Header/Footer.
  2. In the toolbox, click the Label button (refer ahead to Figure 10.7 for its location; if your toolbox isn't visible, choose View, Toolbox). Drag the crosshairs pointer to the Report Header section and click anywhere inside it.
    10fig07.jpg

    Figure 10.7 The report with a label control for the title.

  3. Type National Governments and click outside the box.
  4. Click the label to select it and press F4 to open its property sheet.
  5. On the Format tab, scroll down to Font Size and edit the setting to 16. Edit the Font Weight to Bold and Text Align to Center.
  6. Move your mouse to the upper-right handle of the label and click when the pointer becomes a double-arrow (see Figure 10.6). The text of the label is in full view.
    10fig06.gif

    Figure 10.6 When you click the double arrow, the control resizes so the label is in full view.

  7. On the Format tab, edit the Width slightly to 2.5". Edit Left to 2", Top to 0.5" and Height to 0.5" Your Report Header should look like Figure 10.7.
  8. Close the property sheet.
  9. Click View to see the report.

Adding Totals in the Report Footer

Now let's use the Report Footer. Suppose you'd like a grand total for the area of all Asian countries. Here's how to create the control and calculated expression that will give you this number:

  1. Move your mouse to the bottom of the Report Footer section. When the pointer becomes a double arrow with a bar, drag it to the 1-inch mark on the vertical ruler. You could have also right-clicked the Report Footer bar, chosen Properties, and set the Height property on the Format tab at 1".
  2. In the toolbox, click the Text Box tool (see Figure 10.7).
  3. Drag the pointer to the Report Footer section and position the crosshairs 1 inch from the left and 0.5 inch from the top. Click your mouse.
  4. Select the label, the box on the left. Move your pointer to the middle selector handle on the right border (see Figure 10.8). When the pointer becomes a double arrow, drag it to the .75-inch mark on the horizontal ruler.
    10fig08.gif

    Figure 10.8 The selected label, with sizing handle and double arrow.

  5. Click inside the label. Delete the existing text. Type Total Area and press Enter. Click the Bold button on the Formatting toolbar.
  6. Select the text box and click inside it. Enter an expression as follows:
    1. Type = to tell Access you want an expression.
    2. Type Sum, the function that calculates a total.
    3. Type ([Area]), the field enclosed in brackets and parentheses.
    4. The entire expression is =Sum([Area]). Press Enter.
  7. Press F4 to open the property sheet for the text box. On the Format tab, edit the Format property to Standard and Decimal Places to 0.
  8. Close the property sheet. Click View to switch to Print Preview, and click the Last Page button (refer to Figure 10.4 to refresh your memory of its location). The total area is displayed at the bottom of the page.

When you know how to create a control for the total area, it's simple to add one for the population:

  1. Click View to return to Design view. The total area control should still be selected.
  2. Choose Edit, Duplicate. A copy of the text box and label appears directly below the existing controls.
  3. Move your pointer toward the text box. When the pointer becomes an open hand, drag the duplicate text box 0.5 inch from the top and 4 inches from the left. If you don't know how to move controls, the section "Manipulating Controls" in Chapter 12, "Forms/Report Design Elements," will help you.
  4. Select the label. Click inside it, highlight Area, and edit it to Population. Click outside the control.
  5. Select the text box. Within the expression, highlight Area and edit it to Population. Click outside the control. Your report footer should look like Figure 10.9.
    10fig09.gif

    Figure 10.9 Controls for summing population and area in the Design view of the report.

  6. Choose File, Save (or click the Save button). It's a good idea to save your report periodically if you've done significant work on it.
  7. Click View, click the Last Page button, and scroll to the bottom of the page. The Total Population control has been added.

Sorting and Grouping

Thus far, you might have found creating a report tedious, but you probably haven't found it difficult. To quickly review, you've used:

  • The Detail section, the body of the report, to display your records.
  • The Page Footer to print a page number. You could have as easily used the Page Header, which prints the page number at the top of each page.
  • The Report Header, which prints once at the top of the report, for the title.
  • The Report Footer, which prints once at the end of the report, for aggregate totals.

With the introduction of grouping, you might find that things become a little more difficult. The concept itself is not hard to get, but the nuts and bolts of making grouping work can be confusing. I first want to make sure you understand grouping; then I go step by step through the process of implementing it.

Political Magazine Database

Before adding grouping to the National Governments report, it will be easier to see how it works in a database with just a few records. I use the PoliticalMagazines.mdb database, which is available from the usual webpage. You do not need to open it to review this section, but it's there if you need it.

The Political Magazines table (see Figure 10.10) has data about several small, imaginary journals of opinion. The Politics field shows its political slant: whether it is more likely to be read by wooly-headed internationalists (left) or warmongering unilateralists (right). The Location field shows where the editorial staff is headquartered; the estimated circulation is self-explanatory.

10fig10.gif

Figure 10.10 Table of political magazine data.

The records are currently sorted in the datasheet by name. In Figure 10.11, these same records are displayed in a report where they are grouped by their political bent and, within the group, sorted by name. Both the group and the sort are in ascending order (they're alphabetized): Left precedes right, and within the left group, Metne Reader precedes The Country.

10fig11.gif

Figure 10.11 Magazine data grouped by political tendency.

As you can see, grouping eliminates the need to repeat the values of Left and Right for each record. As readers, you can quickly organize and distinguish the magazines that are on the left from those on the right.

Another powerful advantage of grouping is that, just as you created summary statistics for the entire report, you can add summary statistics for each group. Figure 10.12 shows the same report with the average circulation for each group. (I used the Report Wizard to make it look a bit more professional.)

10fig12.gif

Figure 10.12 Grouped magazine data with aggregate totals.

Sorting and Grouping Dialog Box

Now let's create a group in the rptAdministration report. Despite its name, thus far the primacy of government-type data is not obvious in the report. Just as you grouped records by political tendency in the Political Magazines table, you can group records in the report to spotlight the country's form of government.

You create groups in the report's Sorting and Grouping dialog box. First, let's change the current sort of CountryID (the sort in the original query) to government type:

  1. Choose View, Sorting and Grouping. You can also click the Sorting and Grouping icon, which is shown in Figure 10.13.
    10fig13.jpg

    Figure 10.13 The Administration report in Design view. The GovtType field has been edited in the Sorting and Grouping window so that there is now a GovtType header and GovtType footer.

  2. In the Field/Expression column, open the drop-down list and choose GovtType.
  3. In the Sort Order column, keep Ascending to sort alphabetically.
  4. Close the dialog box. Click View and scroll through your records. The records are now sorted in ascending order (alphabetically) by government type: communist, constitutional monarchy, dictatorship, and so on. Now you'll create the group:
  5. Click View to return to Design view. Click View, Sorting and Grouping. Click in the first row.
  6. In the Group Properties section, edit Group Header to Yes and press Enter. The Sorting and Grouping Indicator now displays the grouping symbol in the first row, next to GovtType. You can see that a GovtType header has been created above the Detail section.
  7. Edit Group Footer to Yes and press Enter (see Figure 10.13). The GovtType footer is now below the Detail section.
  8. Close the dialog box. Choose File, Save to save your changes.

Q&A

Q1: Okay, I can see that I somehow created a group in the dialog box. But I still can't figure out exactly which step did that. How can changing a property of some Access element create the element itself?

A1: Your instincts are correct: You usually create, say, a field or control first and then assign properties to it. Grouping is different. When you select a field in the Field/Expression column, the mere act of editing either its Group Header or its Group Footer property to Yes changes the sort to a group and produces sections for that group in Design view of the report.

Click View and scroll through the first few pages of the report. Hmm, what's going on? The grouped report seems to be the same as the report without grouping, except that there's a little more empty space in it. Where are the group titles for each government type, such as those you saw for the Left and Right groups in Figure 10.11? Where are the aggregate statistics, such as Sum, for each group, as you saw in Figure 10.12?

Click View to return to Design view and scroll down the page. Take another look at the group sections. Yes, there is a GovtType header (a group header) above the Detail section, and, yes, there is a GovtType footer (a group footer) below it. But they're empty—there aren't any controls in them.

Here's the nasty little secret about creating groups in the Sorting and Grouping dialog box. It's like building an aquarium. When you create the group in the Sorting and Grouping dialog box, all you've done is buy a tank. You have got to put water, fish, and a plastic gazebo or two into it to make it into an aquarium. Ignoring the fishy metaphors, you must create the controls—labels, text boxes—to make the groups meaningful and informative.

Group Header

Fortunately, adding the controls is not hard. Because you now have a government type group, you don't need the GovtType field in the Detail section. You want to identify each group by government type, so you can use the same field in the group header section. Here are the steps:

  1. In the Detail section, select the Government Type label and delete it.
  2. Right-click the GovtType Header bar and select Properties. On the Format tab, edit the Height to 0.4".
  3. Select the GovtType text box. Drag it to the GovtType Header section and drop it 0.5 inch from the left and two rows of dots from the top.

Are you having trouble moving the text box into the Header section? When you move the pointer to the top of the text box, make sure it changes to an open hand, not the pointing finger. If you still have trouble, here's an alternative method: Cut the text box, select the group section header bar, paste it, and then position it within the section.

  1. On the Format tab of the Text Box: GovtType property sheet, edit the Width to 2", the Height to 0.2", and the Font Size to 12. Close the property sheet.
  2. In the Detail section, select all four text boxes. Choose Format, Vertical Spacing, Make Equal.
  3. Right-click the Detail section bar, select Properties, and edit the Height of the Detail section to 2" (see Figure 10.14). Close the property sheet.
    10fig14.gif

    Figure 10.14 The Group Header and Detail sections in Design view.

Q&A

Q1: These exercises are tiresome and tedious. Do you really think it's worth my time to go through all these steps for a report I will never want to create?

A1: It's true that you're unlikely to have this exact set of controls and circumstances. But what you are doing here—changing fonts, resizing labels, moving text boxes—involves typical tasks for editing reports. You'll be able to build on this knowledge base for the design challenges you face.

Group Footer

A great advantage of grouping is including summary statistics for each group. These are usually created in the Group Footer.

You've already included summary statistics for the area and population fields in the Report Footer. A little cutting and pasting and some editing will give you the same aggregates for these fields by group:

  1. Move your pointer to the 0.5-inch mark of the vertical ruler in the Report Footer section. When the pointer becomes a right arrow, click to select all four controls (see Figure 10.15).
    10fig15.gif

    Figure 10.15 When the pointer is a right arrow, you can click to select all four controls.

  2. Right-click any of the selected controls for a shortcut menu and choose Copy. You can use any Copy method—choose Edit, Copy; click the Copy button; or press Ctrl+C.
  3. Right-click the GovtType Footer and click Paste.
  4. Click anywhere outside any control so that no control or element is selected.
  5. Right-click the Total Area label and choose Properties. On the Format tab, edit the Caption to Group Area.
  6. Click the Total Population label to select it. On the Format tab of the property sheet, edit the Caption to Group Population. Close the property sheet.
  7. Choose File, Save to save your changes. Click View to see the report.

One thing immediately strikes the eye: Within each group (such as Communist), the country names are not alphabetized. Let's alphabetize them.

  1. Click View to return to Design view.
  2. Choose View, Sorting and Grouping.
  3. Click in the first empty row of the Field/Expression column. Open the drop-down list and choose Country. In the Sort Order column, leave Ascending as is. Close the dialog box.
  4. Click View to see the report (see Figure 10.16).
    10fig16.gif

    Figure 10.16 The report with a group header in Print Preview.

Now let's take a closer look at the report. At the end of the group, there are now group totals for area and population. The same expressions that calculated total area and population for all of Asia when they were used in the report footer section now calculate the group totals when used in the group footer section.

As for the rest of report, it's adequate, but it could be better. Forcing new pages before each group would give you an improved layout. You can also have the group's name appear again at the top of the next page when the group's records span more than one page.

You'll do those tasks in the case study at the end of the chapter.

Close the report and save your changes.

You can open the completed rptAdministration in AsiaChap10End.mdb and compare your own work with it.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020