All docs
V20.2
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

RangeExtensions.Subtotal(CellRange, Int32, List<Int32>, Int32, String) Method

Creates subtotals for the specified range of cells.

Namespace: DevExpress.Spreadsheet

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

Declaration

public static void Subtotal(
    this CellRange range,
    int groupByColumn,
    List<int> subtotalColumnList,
    int functionCode,
    string functionText
)
<ExtensionAttribute>
Public Shared Sub Subtotal(
    range As CellRange,
    groupByColumn As Integer,
    subtotalColumnList As List(Of Integer),
    functionCode As Integer,
    functionText As String
)

Parameters

Name Type Description
range CellRange

A CellRange object that is the range of cells for which the subtotals should be created.

groupByColumn Int32

An integer that specifies the zero-based index of a column containing related data for grouping.

subtotalColumnList List<Int32>

A list of column indexes in a worksheet that defines columns for which the subtotals should be calculated.

functionCode Int32

An integer that specifies the code of the function to be used in calculating subtotals.

functionText String

A string that defines the text to be displayed in the summary rows.

Remarks

The Subtotal method is an extension method of the CellRange object that is called by using the instance method syntax.

Before subtotaling your data, make sure that the range you wish to subtotal has columns headings and the column defined by the groupByColumn parameter has repetitive values. Each time a value in this column changes, a new subtotal row is inserted, so that it is better to sort your data to ensure that the same values in the groupByColumn column will be in one group.

The table below provides a full list of functions that can be used in calculating subtotals.

functionCode

(includes hidden values)

functionCode

(ignores hidden values)

Function Name

fuctionText

(default)

1

101

AVERAGE

Average

2

102

COUNT

Count

3

103

COUNTA

Count

4

104

MAX

Max

5

105

MIN

Min

6

106

PRODUCT

Product

7

107

STDEV

StdDev

8

108

STDEVP

StdDevp

9

109

SUM

Total

10

110

VAR

Var

11

111

VARP

Varp

See Also