Skip to main content
Row

PivotField.GroupItems(PivotFieldGroupByType) Method

Performs grouping of the specified type in the current field.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

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

View Example

Worksheet worksheet = workbook.Worksheets["Report8"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Access the "DATE" field by its name in the collection.
PivotField field = pivotTable.Fields["DATE"];
// Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters | 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