Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

PivotField.GroupItems(PivotFieldGroupByType) Method

Performs grouping of the specified type in the current field.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

void GroupItems(
    PivotFieldGroupByType groupBy
)

Parameters

Name Type Description
groupBy PivotFieldGroupByType

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

Remarks

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.

Example

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)

The following code snippets (auto-collected from DevExpress Examples) contain references to the GroupItems(PivotFieldGroupByType) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also