VSView Reporting Edition Reference > GroupCollection Object > GroupCollection Methods > Add Method (GroupCollection) |
Adds a Group to the Groups collection, and its header/footer Sections to the Sections collection.
[form!]Groups.Add Name As String, GroupBy As String, Sort As GroupSortSettings
The parameters for the Add method are described below:
Name As String
This parameter contains the name of the new group.
GroupBy As String
This parameter contains the value of the GroupBy property for the new group.
Sort As GroupSortSettings
This parameter contains the value of the Sort property for the new group.
NOTE: When you add a group to a report, the control automatically adds two new sections, the group header and group footer sections for the new group.
For example:
Debug.Print vsr.Sections.Count
7
vsr.Groups.Add "NewGroup", "Left([ProductName],1)", vsrAscending
Debug.Print vsr.Sections.Count
9