ActiveReports 6 Online Help
Multiple Groupings

You can nest group header and footer pairs and group each on a different field.

Important: As with any group header and footer pair, group your data on the fields that you specify in the DataField property of the group header, but in the order of your groups. For example:

SELECT * FROM Customers ORDER BY GroupHeader1DataField, GroupHeader2DataField, GroupHeader3DataField

See the image below for the order in which report sections appear on the report. GroupHeader1 in the image was added first and appears above the other two group headers, while GroupFooter1, its partner, appears below the other two group footers.

When you run a report with multiple groupings like the one above, the sections print in an order like the following:

  1. ReportHeader1 prints once and does not repeat.
  2. PageHeader1 prints once at the top of each page.
  3. GroupHeader1 prints once for the first value its DataField returns.
  4. GroupHeader2 prints once for the first value its DataField returns within the context of GroupHeader1's DataField value.
  5. GroupHeader3 prints once for the first value its DataField returns within the context of GroupHeader2's DataField value.
  6. Detail1 prints once for each record that falls within the context of GroupHeader3's DataField value.
  7. GroupFooter3 prints once at the end of the records that fall within the context of GroupHeader3's DataField value.
  8. GroupHeader3 may print again, if more values return within the context of GroupHeader2's DataField value.
  9. Each time GroupHeader3 prints again, it is followed by Detail1 (once for each related record) and GroupFooter3.
  10. GroupFooter2 prints once after GroupFooter3.
  11. GroupHeader2 may print again, if more values return within the context of GroupHeader1's DataField value.
  12. Each time GroupHeader2 prints again, it is followed by Detail1 (once for each related record) and GroupFooter2.
  13. GroupFooter1 prints once after GroupFooter2.
  14. GroupHeader1 prints once for the second value its DataField returns, followed by GroupHeader2, and so on in a pattern similar to the one above.
  15. PageFooter1 prints once at the bottom of each page. (Its position within groupings varies.)
  16. ReportFooter1 prints once at the end of the report.

You can add up to 32 groupings in one report. With many groupings, you might find the need to rearrange the order of your groups. If your report has more than one group and you right-click the report surface, you will see an extra option in the context menu: Reorder Groups. Select that option to open the Group Order window, in which you can drag and drop groups to put them in any order you want.

See Also

How To

Walkthroughs