Partager via


Report Bands

Report bands make it possible for you to specify where and when data displays on the report or label page. For example, suppose you create a contact list ordered by contact last names. You can use report bands to organize the information in this report. The following list contains some possible types of information for which you might want to designate different bands:

  • The name of the list using a title band, which appears once at the beginning of a report.

  • The total number of entries in the list using a summary band, which appears at the end of a report.

  • The report name, page number, and date using page header or page footer bands, which appear at the beginning or end of each page, respectively.

  • A separator between the last names of contacts beginning with each letter of the alphabet, to make it easier to find entries, using group header and footer bands, which appear each time the report moves to a record in which the first letter of the contact last name changes.

You can include the same types of report controls in all types of report bands, such as Field controls and calculated expressions for displaying data. For more information about report controls, see Working with Report Controls.

You choose different types of report bands, and place different types of report controls in each band, to present your data effectively. The following sections contain more information about types of report bands and their structure:

  • Types of Report Bands

  • Choosing Different Band Types for Report Content

  • Comparing Group and Detail Bands in Report Layouts

  • Functional Differences between Group and Detail Bands

Types of Report Bands

Reports contain several bands by default; however, you can add other bands to the report or label. The following table summarizes the types of report bands available and their approximate order in the page layout. Because bands can stretch in side, the table also tells you which bands allows you to continue their contents in multiple pages if their contents overflow a single page.

Band type

Description

Availability in layout

Typically displays

Can span more than a page

Title

Displays information or data that displays once at the beginning of the report.

Optional band, can be placed on separate page at the beginning of the report or immediately before the Page Header band on the first page.

Report title or title page, report date, page number, company logo, title border.

No

Page Header

Displays information or data that displays once per page at the beginning of the page.

Available by default.

Required band on all pages, except when Title and Summary bands are on separate pages. Optionally available on Summary page.

Report name, page number, report date.

No

Column Header

Displays information or data that displays once per set of columns preceding the column set.

Added automatically for each column created by the user. Does not appear when the report has only one column.

Preface to column set.

No

Group Header

Displays information or data that displays once per group preceding the group.

Added automatically for each data group created by the user.

Preface to a data group.

Yes

Detail Header

Displays information or data that displays once per record preceding the record.

Added by the user.

Optional band, available for every Detail Band in the layout.

Preface to a record.

Yes

Detail

Displays information or data that displays once per record in the underlying table.

Available by default.

One Detail Band is required in the report layout. The user can optionally include additional Detail Bands.

Data for each record.

Yes

Detail Footer

Displays information or data that displays once per record following the record.

Optional band, available for every Detail Band in the layout.

Summary for the record.

Yes

Group Footer

Displays information or data that displays once per group following the group.

Added automatically for each data group created by the user.

Calculated values for a data group.

Yes

Column Footer

Displays information or data that displays once per set of columns following the column set.

Added automatically for each column created by the user. Does not appear when the report has only one column.

Summary, column totals.

No

Page Footer

Displays information or data that displays once per page at the end of a page.

Required band on all pages, except when Title and Summary bands are on separate pages. Optionally available on Summary page.

Report name, page number, report date.

No

Summary

Displays information or data that displays once at the end of the report.

Optional band, can be placed on a separate page at the end of the report or immediately before the Page Footer band on the last page.

Report totals, summary page.

Note

You can create grand totals by placing calculated expressions in the Summary band.

Yes

For more information, see Report Designer and Label Designer.

Choosing Different Band Types for Report Content

The use of Title and Summary bands is easily understood by comparing these sections of the report to a book's structure.

The Title band contains information that only appears once at the beginning of the report, similar to the book's front matter, such as a preface, acknowledgements, or table of contents. The Summary contains information only found at the end of the book, such as its index or colophon.

Page Headers and Page Footers are also similar to a book's. The book's title might appear in the top margin of every page, and the page number might appear in the bottom margin. Although books do not often have Column Headers and Column Footers, the use of these bands is also clear from their physical position in the page layout.

However, when a report contains multiple Detail bands and data groups, these bands look similar in the report layout. Their difference in structure in the report might not be clear initially. Also, at runtime, these bands do not always appear in the same physical locations in which they appeared during report or label design.

You can think of Group Headers and Group Footers as having a similar role to the introductory paragraphs and summaries you might find in each chapter of a book. The detail bands are analogous to the paragraphs that appear between these preparatory and concluding chapter sections; they can appear any number of times before the chapter ends.

The following section explains the differences between Detail bands and Group bands in more detail.

Comparing Group and Detail Bands in Report Layouts

When you add Detail bands, they appear consecutively in the page layout. Appearing consecutively means each new Detail band is added after the last Detail band, and each set of Detail Header and Detail Footer bands appear with the corresponding Detail band. A Detail band and its corresponding Detail Header and Detail Footer bands comprise a detail band set; no other bands can separate them. The consecutive structure of multiple Detail band sets makes it possible for you to include data from multiple child tables of a single parent. A Detail band's Target alias tells the Report Engine which set of related child records you want to process in this band. See How to: Specify Target Aliases for Detail Bands for more information.

When you add data groups, they and their corresponding Group Header and Group Footer bands appear nested in the page layout. Appearing nested means the first data group that is created appears at the most outer level in the page layout while the last data group created appears at the most inner level. The nested structure of data groups makes it possible for you to group records in reports based on a grandparent-parent-child relationship. A data group's Group on expression tells the Report Engine when to start a new group. For more information, see How to: Add Data Groups to Reports.

Functional Differences between Group and Detail Bands

The different ways the Report Designer displays Detail band sets and data groups mirror their different functions at run time. The two types of bands help you display different types of data relationships in reports.

For example, suppose you had a customer table with two child tables, orders and payments. Using multiple Detail bands, you can create a report containing the orders and payments for each customer. The orders and payments are not related to each other, because the entries in the orders and payments tables do not necessarily correspond to one another in any way.

In the same example report, suppose you have a SalesPeople table, with each salesperson being responsible for one or more customers. Using a data group, you can nest each salesperson's customers' details within a header or footer showing the name of the sales person. In another table, you store the names of sales territories, with each territory being served by one or more customers. You can nest the SalesPeople group inside an outer group displaying information about each territory.

Group bands occur when their Group on expression changes during the report. In the example report described above, the group expression might be territory or salesperson. A report data group requires a Group on expression. Detail bands have an optional Target alias expression, which may look like a Group on expression, but is quite different. In the example report, the Target alias expressions are "orders" and "payments" or variables referring to the aliases under which each child table is open.

For more information, see Working with Report Data Groups and Working with Related Tables using Multiple Detail Bands in Reports.

Detail band sets and group bands have some additional functional differences in reports:

  • It is impossible to have the Report Engine evaluate on a data group without a Group Header and Group Footer in the layout, representing the corresponding Group on expression. Detail Header and Group Footer bands are optional bands; a Detail band can constitute a detail band set without them.

  • If you include the optional Detail Header and Detail Footer bands for a detail band, these bands can appear in your report even if the child table specified by band’s target alias has no records matching the current parent record. This condition is impossible for Group Headers and Group Footers, since a group cannot exist without at least one detail row satisfying the group's Group on expression.

    Tip

    If you do not want report controls in the Detail Header and Detail Footer to display when the Detail band has no contents, you can use Print when expressions to suppress them. Usually the correct expression to use in this scenario is EOF(<target alias>), where <target alias> is the Target alias expression you used for this Detail band. The EOF() function indicates when the record pointer is placed at end of file for this child table during the report run because there is no valid child record. You can close up the empty space in the Detail Header and Detail Footer bands, when these report controls do not print, using each control's option to Remove line if blank. Refer to How to: Suppress Blank Lines in Report Controls and Print When Tab, Report Control Properties Dialog Box (Report Builder) for more information.

  • The SUMMARY keyword on the REPORT FORM and LABEL FORM commands suppresses detail band sets, including Detail Header and Detail Footer bands. If you have specified expressions to evaluate on entry or on exit for these bands, they do not fire during a SUMMARY report run. SUMMARY does not suppress Group Headers and Group Footers, and their on entry or on exit expressions are evaluated. For more information, see How to: Specify Expressions to Evaluate When Processing Bands.

  • Reports have a limit of 74 nested data groups and a separate limit of 20 Detail band sets. Creating detail band sets does not subtract from the available number of data groups, and creating data groups does not limit the number of detail band sets you can add to your report.

See Also

Tasks

How to: Add Bands to Reports

Other Resources

Working with Report Bands