ActiveReports 8
GroupHeader Class
Members  Example  See Also 
GrapeCity.ActiveReports.v8 Assembly > GrapeCity.ActiveReports.SectionReportModel Namespace : GroupHeader Class

Glossary Item Box

The GroupHeader section prints once for every data group defined using the field specified in DataField property.  A GroupHeader section requires a matching GroupFooter section.

Object Model

GroupHeader Class

Syntax

Visual Basic (Declaration) 
Public Class GroupHeader 
   Inherits Section
C# 
public class GroupHeader : Section 

Remarks

Since ActiveReports does not sort the data before grouping it, your data source should be sorted on all the data fields that you have specified in group header sections.  For example, for a report to properly create two groups on Country and City data fields you must sort the data by those data fields in the specified order.  If your data is not sorted you end up with the same group appearing multiple times in the report at different locations (i.e. the report is NOT grouped).

Example

C#Copy Code
private void groupHeader1_Format(object sender, System.EventArgs eArgs)
{
    this.groupHeader1.ColumnLayout = true;
    this.groupHeader1.DataField = "Country";
    this.groupHeader1.GroupKeepTogether = GroupKeepTogether.None;
    this.groupHeader1.KeepTogether = true;
    this.groupHeader1.NewColumn = NewColumn.None;
    this.groupHeader1.NewPage = NewPage.None;
    this.groupHeader1.RepeatStyle =  RepeatStyle.None;
    this.groupHeader1.UnderlayNext = true;
}
Visual BasicCopy Code
Private Sub GroupHeader1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles GroupHeader1.Format
   Me.GroupHeader1.ColumnLayout = True
   Me.GroupHeader1.DataField = "Country"
   Me.GroupHeader1.GroupKeepTogether = GroupKeepTogether.None
   Me.GroupHeader1.KeepTogether = True
   Me.GroupHeader1.NewColumn = NewColumn.None
   Me.GroupHeader1.NewPage = NewPage.None
   Me.GroupHeader1.RepeatStyle = RepeatStyle.None
   Me.GroupHeader1.UnderlayNext = True
End Sub

Inheritance Hierarchy

System.Object
   GrapeCity.ActiveReports.SectionReportModel.Section
      GrapeCity.ActiveReports.SectionReportModel.GroupHeader

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also