.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PivotField.GroupItems(PivotFieldGroupByType) Method

Performs grouping of the specified type in the current field.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll


void GroupItems(
    PivotFieldGroupByType groupBy


Name Type Description
groupBy PivotFieldGroupByType

A PivotFieldGroupByType enumeration member that determines how the field should be grouped.


Specify a combination of PivotFieldGroupByType enumeration members which correspond to time periods to group by those periods.

Specify a PivotFieldGroupByType.NumericRanges as a parameter to group the field starting from the smallest value to the largest value using automatically calculated group intervals.


This code snippet groups the field by month and quarter.

Dim worksheet As Worksheet = workbook.Worksheets("Report8")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Access the "DATE" field by its name in the collection.
Dim field As PivotField = pivotTable.Fields("DATE")
' Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters Or PivotFieldGroupByType.Months)
See Also