Jan's Illustrated Computer Literacy 101 Logo:Jegsworks Jan's Illustrated Computer Literacy 101


Home > Jan's CompLit 101 > Working with Databases > Forms & Reports > Reports
Icon: Arrow - Previous pagePrevious    NextIcon: Arrow - Next page

Jan's Working with Databases

   Forms & Reports: Reports

Reports are intended primarily for printing or previewing, while forms are intended primarily for use on screen. You cannot change the data in a report from any view. That's the job of a form.

The example reports on this page come from the Day Camp database Icon: In Site in your resource files.

Report Design Goals

  • Print outs should be easy to read.
    • Records do not stretch across multiple pages.
    • No data is cut off or hidden.
    • Data is in a logical order for what the reader needs.
  • Report prints well.
    • Fits on the paper.
    • Minimum of wasted space.
    • Prints well in color and in black-and-white.
  • It is easy to tell what is being totaled.
  • Access can create the report quickly.

Why use a report?

  • To distribute information to others who cannot see the database
  • To have a static record of the values at a specific date/time
  • To group records
  • To produce summaries (report totals, group totals, running totals)
  • To show all controls for a record together
  • To have precise control over the organization and look of your output

Types of Reports

There are several basic types of reports, with uncountable variations.

  • Print Preview: DetailsDetailed - Lists all of the records from the report source.
     
    Records can be grouped based on values or partial values from a field or expression, like the first letter, or on intervals like for a month or week.
     
    Example:
    • Camper and Staff info grouped by camp unit and on the field Staff (Yes or No).
  • Summary - Can include report totals, running totals, and group totals.  Can show only the summary data with no records at all. A "total" can be any aggregate function, including average, count, maximum, or minimum as well as sum.

    Examples: Reports on T-shirts needed per unit or for whole camp

    Print Preview: Groups with subtotals Print Preview: Summary

  • Specialty reports
     
    Examples:

    Print Preview: Mailing Labels Print Preview: Chart

    Print Preview: Report with two columnsPrint Preview: Report with subreport in report header (Access 2013)


Views

There are three views for a report by default, plus one optional view.

  • Report Design ViewReport ViewIcon: Report View Report View - Similar to Print Preview but with no page breaks. Handy if you do not actually need to print. Unlike Print Preview, you can select parts of the report (in gray with gold border in the illustration) to copy and paste to another program.
  • Icon: Design View Report Design View - Like Form Design View. Add, position, and format controls in this view.
  • Example: Report Layout view (Access 2010)Print PreviewIcon: Print Preview Print Preview - Shows how the pages will print. You can display several pages at once.
  • Icon: Layout View Layout View (not allowed by default) - Like Form Layout View. Controls can be resized, moved, and formatted while data shows in them. Older versions of Access used only sample data for Layout View but Access 2007, 2010, 2013, and 2016 show the actual data. Page Header and Footer do not show. No page breaks show.

Report Design View Icon: Design View

Report Design View looks very much like Form Design View. You create controls the same way, dragging fields from the Field List or using the ribbon tools to create controls. You use the Property Sheet to manage the look and behavior of controls, report sections, and the whole report. Each section can be no more than 22" tall and the report can be no more than 22" wide. All sections will be the same width, which can be a problem.

Report sections available:
Each section has its own selection bar running across the design window.

  • Report Design ViewReport Header/Footer - Prints at the beginning/end of the whole report. Your report title goes in the Report Header. Grand totals usually go in the Report Footer, as in the illustration but sometimes the Report Header is a good choice.
     
  • Page Header/Footer - Prints on each page. Page numbers go here, usually in the footer. Since the report title won't show after the first page, you will often want a secondary title in the Page Header.

    You might also want to include column headings, if your Detail put content into columns, as in the illustration.

    A page total would, of course, be put in the Page Header or Page Footer. Page totals are tricky to create.

  • Group Header/Footer - Prints at the beginning/end of a group of records.  A group is named for the field or expression which is used to group the records. A report can have up to 10 sorting or grouping levels.

    Each group can have its own header and/or footer. The illustration shows two groups, with one Group Header (Full Unit) and two group Footers (Full Unit and T-shirt size).  

  • Detail - Shows the data for a single record. The Detail section repeats for each record in the group.

TipMethods to hide a section:

  • Property Sheet: Set the Height of the section to zero.
  • Report Design View: Drag the bottom edge of the section up to meet the top edge. If there are controls in the section, either delete them or resize them vertically to zero height.
  • Sorting and Grouping dialog: Choose "No" for a Group Header or Group Footer. This also hides the section selection bar in Design View AND deletes any controls that were in the section(!).  In the illustration, the group header for T-shirt size was hidden with this method. (More below on the dialog)

Sorting and Grouping

Design View: Pane Group, Sort, and Total (Access 2010)The Group & Sort button on the ribbon Button: Group & Sort opens a pane at the bottom of the Report Design View, called Sort, Group, and Total. This pane shows you a tree diagram of the groups, sorting, and Totals in the report. With this pane you can pick fields to sort and group on, without having to make changes in the source for the report. You have lots of control over how the grouping behaves.

The illustration shows that the report's records are grouped together on values in the field Full Unit, in alphabetical order. Then within each unit, the records are sorted by the field T-shirt type and then grouped on the field T-shirt size.


Print Preview Icon: Print Preview

Print Preview: sections labeledPrint Preview shows how your whole report will print. The illustration shows some of the sections that you might have. Of course, different reports will use different combinations of the possible sections.

Report Header: Shows only on the first page. This could even be a page by itself, like a cover page.

Page Header: Show on every page. By default, the Page Header will show below the Report Header on the first page but at the top of the page on other pages.

Page Footer: Shows on every page at the bottom of the page by default.

Report Print Preview: Report FooterReport Footer: Shows only on the last page, below the last group footer. The Page Footer is still at the bottom of the page.


 Navigation in Print Preview:

  • Navigation buttonsCan't scroll to next page: Unexpectedly, in Access you cannot scroll from page to page in Print Preview, even for a report. Use the navigation buttons at the bottom of the preview window or the arrow keys on the keyboard to change pages.  You can also type in a page number in the text box in the navigation bar.
  • Slow formatting: Any queries that are part of the report's source must run before the report can be displayed. For some reports this can take a long time. You want to avoid using queries that are based on queries that are based on other queries! Keep it as simple as possible.  
  • Skipping pages in navigation: Access must format each page as you advance through the report. If you skip to later pages by typing in a page number, Access still has to format the pages in between. This can take a while for long reports or report with photos. (Unfortunately, it doesn't seem to help to jump to the last page and then go backwards through the pages!)
  • Total number of pages: The total number of pages does not show in the Print Preview window anywhere. You can click on the Last Page button and look at the navigation bar for its page number. But, you must wait for the entire report to format. This can take a while if there are a lot of pages!

    TipBetter: Put a control in the page header or page footer that shows the total number of pages as well as the current page number. That way you will be able to see the total number of pages on the first page!


Property Sheet

The Property Sheet works the same way for reports that it did for forms. Report sections and controls have many of the same properties that those items have in forms, such as Record Source, Font, Border Style, Border Color, Back Color.  There are some differences, of course.

Reports have properties that control what will print and where.

Reports do not have properties about how data is entered or edited, which a form needs.

Useful properties for reports that forms don't have:

  • Page Header - Possible values: All Pages, Not with Rpt Hdr, Not with Rpt Ftr, Not with Rpt Hdr or Ftr
  • Page Footer - similar choices as header
  • Grp Keep Together - Per Column, Per Page
  • Picture Pages - All Pages, First Page, No Pages
    Applies to the background picture for the report that is picked in the Picture property for the report.

Useful properties for controls on a report that form controls don't have:

  • Hide Duplicates: Yes/No.
    If Yes, the report hides a control when the control duplicates the value in previous record's control. This works best on fields that are sorted and lined up in columns. It cleans up the display of the records by showing just the first instance of a value that is repeated in the next records.
  • Running Sum: No, Over Group, Over All
    Used to accumulate a total over for a group or for the whole report. You can use this property to number records in sequence by setting the value of a text box to =1.

Icon: TroubleProblem: A page prints with just a few lines
This happens naturally from time to time. But sometimes you can make adjustments to squeeze those last lines onto the previous page.

However, if you add or remove records later, you may have a different issue the next time you run the report.

Things that might help to print on fewer pages:

  • Page margins - especially top and bottom.
  • Group: Keep group header together with first record or keep group together, or not.
  • Section: Height
  • Do you need the report/page/group header or footer at all?
  • Layout of controls in Detail section. Can you make them take less vertical space?