Sorting and Grouping Settings
Each
grouping in a report has settings that define the group’s attributes.
The settings determine things such as whether the field or expression
is used for sorting, grouping, or both. They are also used to specify
details about the grouping options. To view the sorting and grouping
settings, click More on one of the fields available in the Group, Sort,
and Total window. The band expands to appear as in Figure 3. You can set the following attributes.
Sort Direction— The Sort Direction setting specifies whether you want to sort in ascending or descending order. By Entire Value— The By Entire Value
setting specifies whether you want to group by an entire value, or by a
specific number of starting characters of the value (for example, the
first two characters). With No Totals— The With No Totals
setting specifies what fields you want to total on. If you opt to total
on a field, you can specify the type of calculation you want to perform
(sum, average, count, and so on). You can also designate whether you
want to show the grand total, show a group subtotal as a percent of the
grand total, and whether you want subtotals in the group header and
footer (see Figure 4).
With Title— You use the With Title setting to create a title for the grouping, and to designate a font for that title. With a Header Section— You use the With a Header Section setting to designate whether you want to include a group header. With a Footer Section— You use the With a Footer Section setting to designate whether you want to include a group footer. Do Not Keep Together on One Page— The Do Not Keep Together on One Page
setting determines whether Access tries to keep an entire group
together on one page, whether it will print the group header on a page
only if it can also print the first detail record on the same page, or
whether it makes no attempt to keep the header together with the detail
section.
If you select Keep Whole Group Together on One Page, and the group is too large to fit on a page, Access ignores the property setting. Furthermore, if you select Keep Header and First Record Together on One Page and either the group header or the detail record is too large to fit on one page, that setting is ignored, too.
|
Group Header and Footer Properties and Why to Use Them
Each group header and footer has its own properties that determine the behavior of the group header or footer (see Figure 5).
Force New Page— You can set the Force New Page
property to None, Before Section, After Section, or Before & After.
If it is set to None, no page break occurs either before or after the
report section. If it is set to Before Section, a page break occurs
before the report section prints. If it is set to After Section, a page
break occurs after the report section prints. If it is set to Before
& After, a page break occurs before the report section prints as
well as after it prints. New Row or Col— The New Row or Col
property determines whether a column break occurs whenever the report
section prints. This property applies only to multicolumn reports. The
settings are None, Before Section, After Section, and Before &
After. Like the Force New Page property, this property
determines whether the column break occurs before the report section
prints, after it prints, or before and after, or whether it’s affected
by the report section break at all. Keep Together— The Keep Together
property specifies whether you want Access to try to keep an entire
report section together on one page. If this property is set to Yes,
Access starts printing the section at the top of the next page if it
can’t print the entire section on the current page. When this property
is set to No, Access prints as much of the section as possible on the
current page, inserting page breaks as necessary. If a section exceeds
the page length, Access starts printing the section on a new page and
continues printing it on the following page. Visible— The Visible
property indicates whether the section is visible. It’s common to hide
the visibility of a particular report section at runtime in response to
different situations. You can easily accomplish this by changing the
value of the report section’s Visible property with a macro or VBA code, usually on the Format event. Can Grow and Can Shrink— The Can Grow property determines whether you want the section to stretch vertically to accommodate the data in it. The Can Shrink property specifies whether you want the section to shrink vertically, eliminating blank lines. Repeat Section— The Repeat Section
property is a valuable property that lets you specify whether Access
repeats the group header on subsequent pages if a report section needs
to print on more than one page.
|