Back to Devexpress

PivotField.GroupItems(Double, Double, Double) Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotfield-dot-groupitems-x28-system-dot-double-system-dot-double-system-dot-double-x29.md

latest3.2 KB
Original Source

PivotField.GroupItems(Double, Double, Double) Method

Performs numeric grouping in the current field.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void GroupItems(
    double startValue,
    double endValue,
    double interval
)
vb
Sub GroupItems(
    startValue As Double,
    endValue As Double,
    interval As Double
)

Parameters

NameTypeDescription
startValueDouble

A Double value that is the smallest value to be grouped. If this argument is omitted or null , the smallest value in the field is used.

| | endValue | Double |

A Double value that is the largest value to be grouped. If this argument is omitted or null , the largest value in the field is used.

| | interval | Double |

A Double value that specifies an interval for each group. If this argument is omitted, the group interval is calculated automatically.

|

Example

View Example

csharp
Worksheet worksheet = workbook.Worksheets["Report12"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Access the "Usual Hours Worked" field by its name in the collection.
PivotField field = pivotTable.Fields["Sales"];
// Group field items from 1000 to 4000 by 1000.
field.GroupItems(1000, 4000, 1000, PivotFieldGroupByType.NumericRanges);
vb
Dim worksheet As Worksheet = workbook.Worksheets("Report12")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Access the "Usual Hours Worked" field by its name in the collection.
Dim field As PivotField = pivotTable.Fields("Sales")
' Group field items from 1000 to 4000 by 1000.
field.GroupItems(1000, 4000, 1000, PivotFieldGroupByType.NumericRanges)

See Also

PivotField Interface

PivotField Members

DevExpress.Spreadsheet Namespace