Create Simple Reports in Microsoft Access 2010

  • 7/15/2010
In this chapter from Microsoft Access 2010 Step by Step, you’ll create a report in Access 2010 by using a wizard. After modifying the layout and content of the report, you’ll see how it will look when printed.

Chapter at a Glance

httpatomoreillycomsourcemspimages1745015.jpg

Like forms, reports give people easy access to the information stored in a database. However, there are several differences between forms and reports, including the following:

  • Forms are used to enter, view, and edit information. Reports are used only to view information.

  • Forms are usually displayed on-screen. Reports can be previewed on the screen, but they are usually printed.

  • Forms generally provide a detailed look at records and are usually for the people who actually work with the database. Reports are often used to group and summarize data, and are often for people who don’t work with the database but who use the information stored in the database for other business tasks.

Reports usually present summaries of larger bodies of information. For example, your database might hold detailed information about thousands of orders. If you want to edit those orders or enter new ones, you can do so directly in the table or through a form. If you want to summarize those orders to illustrate the rate of growth of the company’s sales, you generate a report.

Like a book report or an annual report of a company’s activities, a report created in Microsoft Access 2010 is typically used to summarize and organize information to express a particular point of view to a specific audience. When you are designing a report, it is important to consider the point you are trying to make, the intended audience, and the level of information they will need.

In this chapter, you’ll create a report by using a wizard. After modifying the layout and content of the report, you’ll see how it will look when printed.

Creating Reports by Using a Wizard

You can divide the content of an Access report into two general categories: information derived from records in one or more tables, and everything else. The everything else category includes the title, page headers and footers, introductory and explanatory text, and any logos and other graphics.

Just as you can create a form that includes all the fields in a table by using the Form tool, you can create a report that includes all the fields by using the Report tool, which is located in the Reports group on the Create tab. But such a report is merely a prettier version of the table, and it does not summarize the data in any meaningful way. You are more likely to want to create a report based on only some of the fields, and that is a job for the Report wizard.

The Report wizard leads you through a series of questions and then creates a report based on your answers. So the first step in creating a report is to consider the end result you want and what information you need to include in the report to achieve that result. After you provide that information, the wizard creates a simple report layout and adds a text box control and its associated label for each field you specify.

For example, you might want to use a Products table as the basis for a report that groups products by category. When you give the grouping instruction to the wizard, it first sorts the table based on the category, and then sorts the products in each category. In the space at the top of each group (called the group header), the wizard inserts the name of the category.

In this exercise, you’ll use the Report wizard to create a simple report that displays an alphabetical list of products.

  1. With All Access Objects displayed in the Navigation pane, under Tables, click (don’t double-click) Categories.

  2. On the Create tab, in the Reports group, click the Report button.

    httpatomoreillycomsourcemspimages1745017.jpg

    Access creates a report based on all the fields in the Categories table, displays the report in Layout view, and adds four Report Layout Tools contextual tabs to the ribbon.

    httpatomoreillycomsourcemspimages1745019.jpg

    The default report created by the Report tool.

  3. This is not the report we want, so close the Categories report, clicking No when prompted to save it.

  4. On the Create tab, in the Reports group, click the Report Wizard button.

    httpatomoreillycomsourcemspimages1745021.jpg

    The Report wizard starts. Because the Categories table is still selected in the Navigation pane, that table is specified in the Tables/Queries box and its fields are listed in the Available Fields box.

  5. Display the Tables/Queries list, and then click Table: Products.

    The Available Fields box now lists the fields in the Products table.

    httpatomoreillycomsourcemspimages1745023.jpg

    The first page of the Report wizard with the correct table selected.

  6. In the Available Fields list, double-click ProductName, QuantityPerUnit, and UnitsInStock to move them to the Selected Fields box.

  7. At the bottom of the page, click Next.

    The wizard asks whether you want to group the records. When you group by a field, the report inserts a group header at the top of each group of records that have the same value in that field.

  8. In the field list on the left, double-click ProductName.

    In the preview pane on the right, the wizard moves ProductName into the group header area to show that records will be grouped by this field.

  9. In the lower-left corner of the page, click Grouping Options.

    The Grouping Intervals dialog box opens.

    httpatomoreillycomsourcemspimages1745025.jpg

    You can refine the grouping specification in this dialog box.

  10. Display the Grouping intervals list, click 1st Letter, and then click OK.

    The group header now indicates the grouping interval you have assigned to the grouping field.

    httpatomoreillycomsourcemspimages1745027.jpg

    The types of grouping intervals available vary depending on the data type of the field by which you are grouping records.

  11. Click Next.

    The wizard asks how you want to sort and summarize the records.

    httpatomoreillycomsourcemspimages1745029.jpg

    You can sort by up to four fields, each in ascending or descending order.

  12. Click the arrow to the right of the 1 box to display a list of fields, and click ProductName. Then click Next.

    The wizard asks which of three layouts and which orientation you want for this report.

    httpatomoreillycomsourcemspimages1745031.jpg

    The preview on the left shows the effect of the options on the right.

  13. In the Layout area, click each option in turn to see a preview in the report thumbnail to the left.

  14. When you have finished exploring, click Outline.

  15. With Portrait selected in the Orientation area and the Adjust the field width so all fields fit on a page check box selected, click Next.

    The wizard prompts you to supply a title for the report.

    httpatomoreillycomsourcemspimages1745033.jpg

    For ease of use, you should make the title more specific.

  16. In the title box, type Alphabetical List of Products, and then with Preview the report selected, click Finish.

    Access creates the report and displays it in Print Preview.

    httpatomoreillycomsourcemspimages1745035.jpg

    The new report in Print Preview.

  17. Page through the nine-page report, noticing how it is arranged. Then close it.