Partager via


Setting Print Options for Groups

You can control how groups are printed in your report. Sometimes you may want each group to start on a separate page or you may want to control when the group header prints.

Setting Group Page Breaks

In addition to selecting the field or expression to be grouped, the Data Grouping dialog box allows you to specify page break options for groups.

Choosing a Group Header Option

You might want your groups to appear in the next column for multi-column reports, on a new page for forms, or with a new page numbered at 1. The Data Grouping dialog box offers four options to accomplish these tasks. You can:

  • Start a group on a new column.
  • Start each group on a new page.
  • Reset the page number to 1 for each group.
  • Reprint the group header on each page.

After you enter an expression, you can select these options from the Group Properties area.

Preventing Orphaned Group Headers

Sometimes a group may print partially on one page and then finish on the next. To avoid a group header from printing near the bottom of the page with the majority of records on the next page, you can set the minimum distance from the bottom that a group header will print. If the header would be positioned closer to the bottom of the page than the number of inches or centimeters you enter, Visual FoxPro prints the header on a new page.

To prevent orphaned group headers

  1. From the Report menu, choose Data Grouping.

  2. In the Data Grouping dialog box, choose or enter a value in the Start group on new page box.

    Tip   To determine a good value for orphan control, add the Group Header height to one to three times the Detail height.

Printing Suppressed Values When the Group Changes

If repeated values are suppressed, you may want them to print when a particular group changes.

To print repeated values when the group changes

  1. Double-click the control to display the control's dialog box.

  2. Choose the Print When button to display the Print When dialog box.

  3. Select When this group changes.

    The groups defined for the report appear in the box.

  4. Select a group from the box, and then choose OK.

Repeating Group Headers

When a group continues onto the next page, you might want the group header to repeat at the top of the group of continued information. If you have multiple data groups on your report, the header on the subsequent pages will be from the last group in the group list. Place all of the controls you want to print for the group header in the header band of the last group on the list.

To repeat the group header on the next page

  • In the Data Grouping dialog box, select the group you want to repeat and then choose Reprint group header on each page.

    If you don't want to repeat the group header, clear this check box.

See Also

Setting Each Control's Print Options | Controlling Report and Label Output | Adding Reports and Labels | SELECT - SQL