When you add a pair of group header and group footer sections to a report, the new sections appear immediately above and below the detail section.
Note: You cannot add a header section without a corresponding footer section. If you try to do so in code, the results are highly unstable. You can, however, hide one of the sections. To hide a section, set its Visible property to False, or set its Height property to 0. |
Set group header section's DataField property to the field on which you want to group the report. For best results, in the SQL query, order the data by the grouping field.
When you run the report, it renders the group header, followed by all related instances of the detail section, and then the group footer. It renders a new group header section for each instance of the grouping field.
Controls in the group header render once for each instance of the group, so this is a good place for column header labels to describe the data in the detail fields.
With the group header selected in the Properties window, there are a number of properties that allow you to control group header behavior.
For more information on columnar reporting, see Columnar Reports. For more information on KeepTogether options, see KeepTogether Options.
Property | Description |
---|---|
ColumnGroupKeepTogether | If possible, keeps grouped items together in a single column. |
ColumnLayout | If True, lays out the group header with the same number of columns as the detail section. |
DataField | Sets the field on which to group the report. |
GroupKeepTogether | If possible, keeps grouped items together on a single page. |
KeepTogether | If possible, keeps the section together on a single page. |
NewColumn | Tells the group to begin a new column before or after the group field changes. |
NewPage | Tells the group to begin a new page before or after the group field changes. |
RepeatStyle | Allows you to have the group header render on each page or column for long groups. |
UnderlayNext | If True, renders the group header as a layer underneath the following section. This is useful if you want to render a group header control in the same row as data in a nested group header or in the detail section. Take care to leave the BackColor property set to Transparent in the following section, or the group header is hidden. |