Back to Tutorial

Lesson 14: Using Reports to Make Data Meaningful to Others

/en/access2007/using-queries-to-make-data-meaningful-part-2/content/

Introduction

Access 2007 Now that you know how to use queries to analyze the data in a database, it's time to find out how to create a report that will make the data meaningful to someone else. In this lesson, we'll show you how to create a report using the Report command, as well as how to use grouping options and query limits to make the report easier to read and how to identify several report formatting and layout options that can be set in Layout view. Finally, you'll learn how to use Print Preview and save the report.

Using reports to make data meaningful to others

As you know, queries make the data in a database meaningful to you. Sometimes, though, you need to share that data with someone else. A report is an effective way to present your data using an attractive layout. The text can be formatted in an Access report similar to how it can be done in Word documents.

Access 2007 offers tools that allow you to create and format a report. The Report Wizard walks you through the steps of creating a report. The Report command, however, is much easier to use, and all of the formatting options are still available to you in Layout view once the report is created. With these tools, you can create a report based on a table or query.

Creating a report based on a table

One of the easiest ways to create a report is by using a table as the source of the report. For example, in our bookstore scenario we have a table that lists all of the books in our inventory. We want to create a Book Price List report that lists all of the details for each book in our store's inventory. The Report command makes this incredibly easy because it automatically includes every field in the source table in the report.

To create a report based on a table using the Report command:

  • Choose the table you want to use as the source of your report. To do this, you can either open the table or highlight the table name in the navigation pane. In our example, we used the open Books table to create the report.


    Report from TableReport from Books Table
  • Select the Report command on the Create tab on the Ribbon, as seen above.
  • The report is automatically generated and includes every field in the table in order of their appearance in the table. This can be seen in the example below, which was created from the table above.
Price List ReportBook Price List

The layout and formatting of the report can be manipulated in Layout view.

Creating a report based on a query

Access 2007 can also create a report using a query as the source. The process for creating a report based on a query is identical to the process for creating a report based on a table, which was outlined on the previous page. And just like when making a report from a table, every field and record that appears in the query results will appear on the report.

It's possible to limit the number of records in a report, but only if the report was based on a query. The limit is set in the query itself, using the query design screen.

To limit the number of records in a report:

  • Open the query in Design view.
  • Use the Return option in the Query Setup command group to set the number of records you want to see in the query results and in the final report.


    Return LimitReturn Limit
  • Click Run! to make sure the query results look like you want the report to look.
  • Create the report using the Report command on the Create tab.
  • Format the report as desired.

Grouping items on a report

Grouping items on a report can make it much more readable. Access 2007 offers a quick and easy way to add grouping to a report.

To add grouping to a report:

  • With the report open, select the Group & Sort command from the Grouping & Totals command group on the Format tab on the Ribbon.


    Grouping CommandGrouping Command for Reports
  • This opens a Group, Sort, and Total dialog box in the lower portion of the window.


    Grouping ScreenGroup, Sort, and Total Dialog Box
  • In the Group, Sort, and Total dialog box, select Add a group.
  • Select the field you want to group by from the drop-down list. We chose to group our list by Category.


    Grouping Drop Down ListGrouping Drop Down List
  • When you release the mouse button, the report will now appear with items grouped. Our report is grouped on Category now, as seen below.
Books Price ListBooks Price List Grouped on Category

The Group, Sort, and Total dialog box will remain open until you close it.

Formatting a report in Layout view

Access 2007 opens the created report in Layout view so you can easily make modifications. In Layout view, you can change the look of your report in many different ways, including:

  • Deleting columns and other report elements
  • Moving and resizing columns
  • Adding a logo
  • Changing the title and other text on the report headings
  • Applying a report style with AutoFormat
  • Modifying the page layout

To delete a column or other report element

  • Highlight the element by clicking it.
  • Hit the Delete button on your keyboard.

To move a column or other report element:

  • Highlight the element by clicking it.
  • Drag and drop the element to a new location on the report.

To resize a column or other report element:

  • Highlight the element by clicking it.
  • Drag and drop the edge of the element to the new size on the report.

To add a logo to the report:

  • Click the Logo command on the Format tab on the Ribbon.


    Report LogoLogo Command for Report
  • When the Insert Picture dialog box opens, find the picture file.
    InsertLogoInsert Picture Dialog Box
  • Click OK.

To modify the title of a report:

  • Click the Title command on the Format tab on the Ribbon.


    Report TitleTitle Command for Report
  • When the highlight appears, type the new title.

To modify text in report headings:

If you don't like the standard font face and size Access used to create your report, you can modify them using common Microsoft Office text formatting commands. You can modify the size, font face, font color, alignment, and much more. They all work basically the same way.

  • Highlight the text you want to change.
  • Select the formatting option you want from the lists that appear when you click a command.


    Report Text CommandsText Commands for Report
  • The change appears when you release the mouse button.

To apply an AutoFormat style:

Like with forms, Access 2007 offers a variety of report styles in the AutoFormat command. To apply a style:

  • Click the AutoFormat command on the Ribbon.


    Report AutoFormatsAutoFormats for Report
  • Select a format from the drop-down list. The change is applied instantly.

To change the page layout:

When a report is created, it opens in Layout view, like the one in the picture below. The dotted lines are showing where the edge of the page will be in Report view.

Report Layout ViewReport in Layout View

To change the page layout options:

  • Switch to Print Preview using the Views command on the Ribbon.


    Print PreviewPrint Preview Command
  • Select the layout option you want to alter from the Page Layout command group on the Ribbon.
Page Layout OptionsPage Layout Options for Report

All of the standard Microsoft page layout options are available, including:

Page Layout OptionDescription
MarginsTo set the margins for narrow, wide, or normal
OrientationTo select either a portrait or landscape orientation
SizeTo set paper size

Saving a report

When you have created and modified a report and try to close it, Access 2007 will prompt you to name and save the report. If you do not need this report again, you do not need to save it. However, if you think you may want to publish it again, it is best to save.

To save a report:

  • Right-click the Report tab.
  • Choose Save from the list that appears.
  • When the Save As dialog box opens, give the report a name.
    Save ReportSave as Dialog Box
  • Click OK.

Challenge!

If you haven't already done so, save the sample Ready2Read database to your computer.

  • Create a report based on a table.
  • Create a report based on query.
  • Modify the layout of a report by:
    • Resizing or moving columns
    • Deleting report elements
    • Giving the report a new title
    • Applying an AutoFormat style to the report
    • Using groups, sorts, or totals in a report