ComponentOne VSView Reporting Edition
GroupBy Property

Returns or sets the expression used to break records into groups.

Syntax

group.GroupBy[ = value As String ]

Remarks

The GroupBy property contains a VBScript expression that is evaluated for every record in the source recordset. A new group is started whenever the value of this expression changes. For example,

vsr.Groups(0).GroupBy = "CategoryName"

vsr.Groups(0).Sort    = vsrAscending

 

vsr.Groups(1).GroupBy = "ProductName"

vsr.Groups(1).Sort    = vsrAscending

The code above would group records by category name, then by product name. Note that the GroupBy property inserts group breaks. To sort the records, you should also use the Sort property.

The expression used for grouping is not limited to field names, it can contain any VBScript functions. For example:

vsr.Groups(0).GroupBy = "Left([ProductName],1)"

vsr.Groups(1).GroupBy = "DatePart([ShippedDate],'q')"

The code above would group records by the first letter of the product name, then by the quarter of the shipped date.

Data Type

String

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback