officefileapi-devexpress-dot-spreadsheet-dot-pivotfield-dot-groupitems-x28-devexpress-dot-spreadsheet-dot-pivotfieldgroupbytype-x29.md
Performs grouping of the specified type in the current field.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
void GroupItems(
PivotFieldGroupByType groupBy
)
Sub GroupItems(
groupBy As PivotFieldGroupByType
)
| 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.
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);
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.
// Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters | PivotFieldGroupByType.Months);
#endregion #GroupFieldByDates
// Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters | PivotFieldGroupByType.Months);
#endregion #GroupFieldByDates
// Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters | PivotFieldGroupByType.Months);
#endregion #GroupFieldByDates
' Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters Or PivotFieldGroupByType.Months)
' #End Region ' #GroupFieldByDates
' Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters Or PivotFieldGroupByType.Months)
' #End Region ' #GroupFieldByDates
' Group field items by quarters and months.
field.GroupItems(PivotFieldGroupByType.Quarters Or PivotFieldGroupByType.Months)
#End Region ' #GroupFieldByDates
See Also