[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Collapse]API Reference
  [Expand]DevExpress.BarCodes
  [Expand]DevExpress.Compression
  [Expand]DevExpress.Docs.Text
  [Expand]DevExpress.Office
  [Expand]DevExpress.Office.Drawing
  [Expand]DevExpress.Office.Export
  [Expand]DevExpress.Office.Export.Html
  [Expand]DevExpress.Office.Import
  [Expand]DevExpress.Office.Localization
  [Expand]DevExpress.Office.Options
  [Expand]DevExpress.Office.Services
  [Expand]DevExpress.Office.Utils
  [Expand]DevExpress.Pdf
  [Expand]DevExpress.Pdf.Localization
  [Expand]DevExpress.Snap
  [Collapse]DevExpress.Spreadsheet
   [Expand]ActiveSheetChangedEventArgs Class
    ActiveSheetChangedEventHandler Delegate
   [Expand]ActiveSheetChangeEventArgsBase Class
   [Expand]ActiveSheetChangingEventArgs Class
    ActiveSheetChangingEventHandler Delegate
   [Expand]Alignment Interface
   [Expand]AreasCollection Interface
   [Expand]ArrayFormula Interface
   [Expand]ArrayFormulaCollection Interface
    ArrowheadSize Enumeration
    ArrowheadType Enumeration
   [Expand]ArrowSettings Interface
   [Expand]AutoFilterBase Interface
   [Expand]AutoFilterColumn Interface
   [Expand]AutoFilterColumnCollection Interface
   [Expand]AverageConditionalFormatting Interface
    BeforeExportEventHandler Delegate
    BeforeImportEventHandler Delegate
   [Expand]BeforePrintSheetEventArgs Class
    BeforePrintSheetEventHandler Delegate
   [Expand]Border Interface
    BorderLineStyle Enumeration
   [Expand]Borders Interface
    BuiltInStyleId Enumeration
    BuiltInTableStyleId Enumeration
    CalculationEngineType Enumeration
    CalculationMode Enumeration
   [Expand]CalculationOptions Interface
   [Expand]Cell Interface
   [Expand]CellCollection Interface
   [Expand]CellKey Structure
   [Expand]CellValue Class
    CellValueType Enumeration
   [Expand]ChartSheet Interface
   [Expand]ChartSheetCollection Interface
   [Expand]ChartSheetPrintOptions Interface
    ChartSheetProtection Enumeration
   [Expand]ChartSheetView Interface
   [Expand]ClipboardDataObtainedEventArgs Class
    ClipboardDataObtainedEventHandler Delegate
   [Expand]ClipboardDataPastedEventArgs Class
    ClipboardDataPastedEventHandler Delegate
    ClipboardDataPastingEventHandler Delegate
   [Expand]ColorScale2ConditionalFormatting Interface
   [Expand]ColorScale3ConditionalFormatting Interface
   [Expand]Column Interface
   [Expand]ColumnCollection Interface
   [Expand]ColumnsChangedEventArgs Class
   [Expand]ColumnsChangingEventArgs Class
    ColumnsInsertedEventHandler Delegate
    ColumnsRemovedEventHandler Delegate
   [Expand]Comment Interface
   [Expand]CommentChangedEventArgs Class
    CommentChangedEventHandler Delegate
   [Expand]CommentCollection Interface
   [Expand]CommentInsertingEventArgs Class
    CommentInsertingEventHandler Delegate
   [Expand]CommentRemovingEventArgs Class
    CommentRemovingEventHandler Delegate
   [Expand]CommentRun Interface
   [Expand]CommentRunCollection Interface
    CommentsPrintMode Enumeration
   [Expand]ConditionalFormatting Interface
    ConditionalFormattingAverageCondition Enumeration
   [Expand]ConditionalFormattingCollection Interface
   [Expand]ConditionalFormattingCustomIcon Structure
    ConditionalFormattingDataBarAxisPosition Enumeration
    ConditionalFormattingDataBarDirection Enumeration
    ConditionalFormattingExpressionCondition Enumeration
   [Expand]ConditionalFormattingExtremumValue Interface
   [Expand]ConditionalFormattingIconSetInsideValue Interface
   [Expand]ConditionalFormattingIconSetValue Interface
   [Expand]ConditionalFormattingInsideValue Interface
    ConditionalFormattingRangeCondition Enumeration
    ConditionalFormattingRankCondition Enumeration
    ConditionalFormattingSpecialCondition Enumeration
    ConditionalFormattingTextCondition Enumeration
    ConditionalFormattingTimePeriod Enumeration
   [Expand]ConditionalFormattingValue Interface
    ConditionalFormattingValueOperator Enumeration
    ConditionalFormattingValueType Enumeration
   [Expand]ConnectorFormat Interface
    ConnectorType Enumeration
   [Expand]CopiedRangePastedEventArgs Class
    CopiedRangePastedEventHandler Delegate
   [Expand]CopiedRangePastingEventArgs Class
    CopiedRangePastingEventHandler Delegate
   [Expand]CustomCellInplaceEditor Interface
   [Expand]CustomCellInplaceEditorCollection Interface
    CustomCellInplaceEditorType Enumeration
   [Expand]CustomFilter Interface
   [Expand]CustomXmlPartCollection Interface
   [Expand]DataBarConditionalFormatting Interface
    DataBindingDirection Enumeration
   [Expand]DataBindingErrorEventArgs Class
    DataBindingErrorEventHandler Delegate
    DataBindingErrorType Enumeration
   [Expand]DataImportOptions Class
    DataSourceEditingOptions Enumeration
   [Expand]DataSourceImportOptions Class
   [Expand]DataSourceOptionsBase Class
   [Expand]DataValidation Interface
   [Expand]DataValidationCollection Interface
    DataValidationErrorStyle Enumeration
    DataValidationImeMode Enumeration
    DataValidationOperator Enumeration
    DataValidationType Enumeration
   [Expand]DateGrouping Class
    DateTimeGroupingType Enumeration
   [Expand]DefinedName Interface
   [Expand]DefinedNameCollection Interface
   [Expand]DefinedNameConflictResolvingEventArgs Class
    DefinedNameConflictResolvingEventHandler Delegate
    DeleteMode Enumeration
    DiagonalBorderType Enumeration
   [Expand]DocumentCustomProperties Interface
   [Expand]DocumentFormat Structure
   [Expand]DocumentOptions Class
   [Expand]DocumentProperties Interface
    DocumentSecurity Enumeration
   [Expand]DocumentSettings Interface
    DynamicFilterType Enumeration
   [Expand]EditRangePermission Class
   [Expand]EncryptedFileIntegrityCheckFailedEventArgs Class
    EncryptedFileIntegrityCheckFailedEventHandler Delegate
   [Expand]EncryptedFilePasswordRequestEventArgs Class
    EncryptedFilePasswordRequestEventHandler Delegate
   [Expand]EncryptionOptions Interface
    EncryptionType Enumeration
    ErrorsPrintMode Enumeration
    ErrorType Enumeration
   [Expand]ErrorValueInfo Interface
   [Expand]ExpressionConditionalFormatting Interface
   [Expand]ExternalDataSourceOptions Class
   [Expand]ExternalDefinedName Interface
   [Expand]ExternalWorkbook Interface
   [Expand]ExternalWorkbookCollection Interface
   [Expand]ExternalWorksheet Interface
   [Expand]Fill Interface
    FillType Enumeration
    FilterComparisonOperator Enumeration
   [Expand]FilterCriteria Interface
    FilterType Enumeration
   [Expand]FilterValue Class
   [Expand]FloatingObject Interface
    FontSchemeStyles Enumeration
   [Expand]Formatting Interface
   [Expand]FormulaExpressionConditionalFormatting Interface
   [Expand]GradientFill Interface
    GradientFillType Enumeration
   [Expand]GradientStop Interface
   [Expand]GradientStopCollection Interface
   [Expand]HeaderFooterCode Class
   [Expand]HeaderFooterPicture Interface
    HeaderFooterSection Enumeration
   [Expand]Hyperlink Interface
   [Expand]HyperlinkBase Interface
   [Expand]HyperlinkCollection Interface
   [Expand]IBindingRangeValueConverter Interface
   [Expand]ICellValueConverter Interface
   [Expand]IClipboardManager Interface
   [Expand]IconSetConditionalFormatting Interface
    IconSetType Enumeration
   [Expand]ICustomXmlPart Interface
   [Expand]IDataSourceColumnTypeDetector Interface
   [Expand]IDataValueConverter Interface
   [Expand]IgnoredError Interface
   [Expand]IgnoredErrorCollection Interface
    IgnoredErrorType Enumeration
    InsertCellsMode Enumeration
    InvalidFormatExceptionEventHandler Delegate
   [Expand]IRangeProvider Interface
   [Expand]ISpreadsheetComponent Interface
   [Expand]ISupportsFormatting Interface
   [Expand]IUsedNameSet Interface
   [Expand]IWorkbook Interface
   [Expand]IWorkbookMergeResult Interface
   [Expand]Margins Interface
    MergeCellsMode Enumeration
   [Expand]PageBreaksCollection Interface
    PageOrder Enumeration
    PageOrientation Enumeration
   [Expand]PanesFrozenEventArgs Class
    PanesFrozenEventHandler Delegate
   [Expand]PanesUnfrozenEventArgs Class
    PanesUnfrozenEventHandler Delegate
   [Expand]Parameter Interface
   [Expand]ParametersCollection Interface
    PasteSpecial Enumeration
    PatternType Enumeration
   [Expand]Picture Interface
   [Expand]PictureCollection Interface
    PivotAxisType Enumeration
    PivotBaseItemType Enumeration
   [Expand]PivotBehaviorOptions Interface
   [Expand]PivotCache Interface
   [Expand]PivotCacheCollection Interface
    PivotCacheType Enumeration
   [Expand]PivotCalculatedFieldCollection Interface
   [Expand]PivotCalculatedItemCollection Interface
    PivotDataConsolidationFunction Enumeration
   [Expand]PivotDataField Interface
   [Expand]PivotDataFieldCollection Interface
   [Expand]PivotField Interface
   [Expand]PivotFieldBehaviorOptions Interface
   [Expand]PivotFieldCollection Interface
    PivotFieldGroupByType Enumeration
   [Expand]PivotFieldGroupingInfo Interface
   [Expand]PivotFieldLayout Interface
   [Expand]PivotFieldReference Interface
   [Expand]PivotFieldReferenceBase Interface
   [Expand]PivotFieldReferenceCollection Interface
   [Expand]PivotFieldSortOptions Interface
    PivotFieldSortType Enumeration
   [Expand]PivotFilter Interface
   [Expand]PivotFilterCollection Interface
    PivotFilterTop10Type Enumeration
    PivotFilterType Enumeration
   [Expand]PivotGroupingValue Class
   [Expand]PivotItem Interface
   [Expand]PivotItemCollection Interface
   [Expand]PivotItemReference Class
   [Expand]PivotLayout Interface
   [Expand]PivotLocation Interface
   [Expand]PivotPageField Interface
   [Expand]PivotPageFieldCollection Interface
    PivotPageOrder Enumeration
    PivotReportLayout Enumeration
    PivotShowValuesAsType Enumeration
    PivotSubtotalFunctions Enumeration
    PivotSubtotalType Enumeration
   [Expand]PivotTable Interface
   [Expand]PivotTableCollection Interface
   [Expand]PivotViewOptions Interface
    Placement Enumeration
   [Expand]ProtectedRange Interface
   [Expand]ProtectedRangeCollection Interface
   [Expand]Protection Interface
   [Expand]Range Interface
   [Expand]RangeConditionalFormatting Interface
   [Expand]RangeCopiedEventArgs Class
    RangeCopiedEventHandler Delegate
   [Expand]RangeCopyingEventArgs Class
    RangeCopyingEventHandler Delegate
   [Expand]RangeDataSourceOptions Class
   [Expand]RangeExtensions Class
   [Expand]RankConditionalFormatting Interface
   [Expand]RealTimeData Interface
    ReferenceElement Enumeration
    ReferenceStyle Enumeration
   [Expand]RichTextRange Interface
   [Expand]RichTextRun Interface
   [Expand]RichTextRunFont Class
   [Expand]RichTextString Class
   [Expand]Row Interface
   [Expand]RowCollection Interface
    RowFormatMode Enumeration
   [Expand]RowsChangedEventArgs Class
   [Expand]RowsChangingEventArgs Class
   [Expand]RowsColumnsChangingEventArgsBase Class
    RowsInsertedEventHandler Delegate
    RowsRemovedEventHandler Delegate
    ScriptType Enumeration
   [Expand]ScrollPositionChangedEventArgs Class
    SearchBy Enumeration
    SearchIn Enumeration
   [Expand]SearchOptions Class
   [Expand]Shape Interface
   [Expand]ShapeChangedEventArgs Class
   [Expand]ShapeChangingEventArgs Class
   [Expand]ShapeCollection Interface
   [Expand]ShapeFormatBase Interface
   [Expand]ShapeGeometry Interface
    ShapeGeometryPreset Enumeration
   [Expand]ShapeHyperlink Interface
   [Expand]ShapesCopyingEventArgs Class
    ShapesCopyingEventHandler Delegate
   [Expand]ShapeText Interface
    ShapeTextAutoSizeType Enumeration
    ShapeTextHorizontalAnchorType Enumeration
    ShapeTextHorizontalOverflowType Enumeration
    ShapeTextOrientationType Enumeration
    ShapeTextParagraphAlignment Enumeration
   [Expand]ShapeTextParagraphFormat Interface
   [Expand]ShapeTextRange Interface
    ShapeTextReadingOrderType Enumeration
    ShapeTextVerticalAnchorType Enumeration
    ShapeTextVerticalOverflowType Enumeration
    ShapeTextWarpFormat Enumeration
    ShapeType Enumeration
   [Expand]Sheet Interface
   [Expand]SheetAutoFilter Interface
   [Expand]SheetCollection Interface
   [Expand]SheetInsertedEventArgs Class
    SheetInsertedEventHandler Delegate
   [Expand]SheetRemovedEventArgs Class
    SheetRemovedEventHandler Delegate
   [Expand]SheetRemovingEventArgs Class
    SheetRemovingEventHandler Delegate
   [Expand]SheetRenamedEventArgs Class
    SheetRenamedEventHandler Delegate
   [Expand]SheetRenamingEventArgs Class
    SheetRenamingEventHandler Delegate
    SheetType Enumeration
   [Expand]SortCondition Class
   [Expand]SortField Class
   [Expand]SortState Interface
   [Expand]Sparkline Interface
    SparklineAxisScaling Enumeration
   [Expand]SparklineCollection Interface
   [Expand]SparklineColor Interface
   [Expand]SparklineGroup Interface
   [Expand]SparklineGroupCollection Interface
    SparklineGroupType Enumeration
   [Expand]SparklineHorizontalAxis Interface
   [Expand]SparklinePoints Interface
   [Expand]SparklineVerticalAxis Interface
   [Expand]SpecialConditionalFormatting Interface
   [Expand]SpreadsheetBeforeExportEventArgs Class
   [Expand]SpreadsheetBeforeImportEventArgs Class
   [Expand]SpreadsheetCustomAssemblyLoadingEventArgs Class
    SpreadsheetCustomAssemblyLoadingEventHandler Delegate
   [Expand]SpreadsheetFont Interface
   [Expand]SpreadsheetFontProperties Interface
    SpreadsheetFontStyle Enumeration
   [Expand]SpreadsheetHistory Interface
    SpreadsheetHorizontalAlignment Enumeration
   [Expand]SpreadsheetImageSource Class
   [Expand]SpreadsheetInvalidFormatExceptionEventArgs Class
   [Expand]SpreadsheetMailMergeOptions Interface
   [Expand]SpreadsheetValidateCustomSqlQueryEventArgs Class
    SpreadsheetValidateCustomSqlQueryEventHandler Delegate
    SpreadsheetVerticalAlignment Enumeration
   [Expand]Style Interface
   [Expand]StyleCollection Interface
   [Expand]StyleFlags Interface
   [Expand]Table Interface
   [Expand]TableAutoFilter Interface
   [Expand]TableCollection Interface
   [Expand]TableColumn Interface
   [Expand]TableColumnCollection Interface
   [Expand]TableStyle Interface
   [Expand]TableStyleCollection Interface
   [Expand]TableStyleElement Interface
   [Expand]TableStyleElements Interface
    TableStyleElementType Enumeration
   [Expand]TextConditionalFormatting Interface
   [Expand]TimePeriodConditionalFormatting Interface
    Top10Type Enumeration
    TotalRowFunction Enumeration
    UnderlineType Enumeration
   [Expand]ValueObject Class
   [Expand]Workbook Class
   [Expand]WorkbookExtensions Class
   [Expand]WorkbookMergeOptions Class
   [Expand]Worksheet Interface
   [Expand]WorksheetCollection Interface
   [Expand]WorksheetDataBinding Interface
   [Expand]WorksheetDataBindingCollection Interface
   [Expand]WorksheetExtensions Class
   [Expand]WorksheetHeaderFooter Interface
   [Expand]WorksheetHeaderFooterOptions Interface
   [Expand]WorksheetOutlineOptions Interface
   [Expand]WorksheetPageNumbering Interface
    WorksheetPageNumberingStartType Enumeration
   [Expand]WorksheetPrintOptions Interface
   [Expand]WorksheetPrintTitleOptions Interface
    WorksheetProtectionPermissions Enumeration
   [Expand]WorksheetTableDataBinding Interface
   [Expand]WorksheetView Interface
    WorksheetViewType Enumeration
    WorksheetVisibilityType Enumeration
    WorksheetZoomMode Enumeration
  [Expand]DevExpress.Spreadsheet.Charts
  [Expand]DevExpress.Spreadsheet.Drawings
  [Expand]DevExpress.Spreadsheet.Export
  [Expand]DevExpress.Spreadsheet.Formulas
  [Expand]DevExpress.Spreadsheet.Functions
  [Expand]DevExpress.UnitConversion
  [Expand]DevExpress.XtraPrinting
  [Expand]DevExpress.XtraPrintingLinks
  [Expand]DevExpress.XtraRichEdit
  [Expand]DevExpress.XtraRichEdit.API.Layout
  [Expand]DevExpress.XtraRichEdit.API.Native
  [Expand]DevExpress.XtraRichEdit.API.Native.Implementation
  [Expand]DevExpress.XtraRichEdit.Commands
  [Expand]DevExpress.XtraRichEdit.Export
  [Expand]DevExpress.XtraRichEdit.Export.Html
  [Expand]DevExpress.XtraRichEdit.Export.Rtf
  [Expand]DevExpress.XtraRichEdit.Forms
  [Expand]DevExpress.XtraRichEdit.Import
  [Expand]DevExpress.XtraRichEdit.Localization
  [Expand]DevExpress.XtraRichEdit.Services
  [Expand]DevExpress.XtraRichEdit.Utils
  [Expand]DevExpress.XtraSpreadsheet
  [Expand]DevExpress.XtraSpreadsheet.Export
  [Expand]DevExpress.XtraSpreadsheet.Export.Html
  [Expand]DevExpress.XtraSpreadsheet.Import
  [Expand]DevExpress.XtraSpreadsheet.Localization
  [Expand]DevExpress.XtraSpreadsheet.Services
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

TotalRowFunction Enumeration

Lists functions to calculate the totals of table columns.

Namespace:DevExpress.Spreadsheet
Assembly:DevExpress.Spreadsheet.v18.2.Core.dll

Expanded Public Members

Show: Inherited
  Name Description
Public field Average Returns the average (arithmetic mean) of the numbers contained in the table column.
Public field Count Returns the number of cells with non-empty values contained in the table column.
Public field CountNums Returns the number of cells with numeric values contained in the table column.
Public field Custom Indicates that a custom formula (TableColumn.TotalRowFormula or TableColumn.TotalRowArrayFormula) is used to calculate the total for the table column.
Public field Max Returns the largest number contained in the table column.
Public field Min Returns the smallest number contained in the table column.
Public field None Indicates that neither a predefined function (TableColumn.TotalRowFunction) nor a custom formula (TableColumn.TotalRowFormula or TableColumn.TotalRowArrayFormula) is used to calculate the total for the table column.
Public field StdDev Calculates the standard deviation based on the sample contained in the table column.
Public field Sum Returns the sum of the numbers contained in the table column.
Public field Var Calculates the variance of the sample contained in the table column.
Top

Expanded Remarks

The TotalRowFunction enumeration members are used by the TableColumn.TotalRowFunction property.

Expanded Example

This example demonstrates how to create a table from a range of cells. The sample range includes a list of products and invoice information on each product: price, quantity and discount.

The resulting table will provide an additional column to calculate the amount per product, and an additional row to show the total amount. Follow the steps below:

  1. Create a Table

    Add a new Table object to the worksheet's collection of tables (Worksheet.Tables) via the TableCollection.Add method. Pass the following parameters:

    • The range of cells that you wish to format as a table. Use the "B2:F5" range reference instead of "B2:E5" to include an additional column to the right that calculates and displays product amounts.
    • A Boolean value indicating that the top row of the specified range will be the table header.
  2. Format the Table

    Format the table by applying one of the built-in table styles. To do this, set the Table.Style property to the table style object from the IWorkbook.TableStyles collection. Access the desired style by its BuiltInTableStyleId identifier.

  3. Table Columns

    Access table columns by their indexes from the column collection that the Table.Columns property returns.

  4. Table Header Row

    To specify the last column header, set its TableColumn.Name property to "Amount". Headers of other table columns are automatically set to the values of the corresponding cells:

    • table.Columns[0].Name = "Product"
    • table.Columns[1].Name = "Price"
    • table.Columns[2].Name = "Quantity"
    • table.Columns[3].Name = "Discount"
  5. Calculated Column

    Specify the formula to calculate the product amount, and assign it to the Amount column using the TableColumn.Formula property. In the formula, refer to table columns by their headers.

  6. Table Total Row

    Set the Table.ShowTotals property to true, to display the total row at the bottom of the table.

  7. Total Row Function

    Specify the function to calculate the total amount. To do this, set the TableColumn.TotalRowFunction property of the Amount column to Sum.

    Note

    In the total row, you can use any formulas you wish, not only functions listed by the TotalRowFunction enumerator. To use a custom formula in the total row, assign it to the TableColumn.TotalRowFormula property of the required table column.

  8. Table Ranges and Data Ranges

    Specify number formats to display numbers as currency values in the Price and Amount columns, and as percentage values in the Discount column. To access the data range of a table column, use the TableColumn.DataRange property.

    Use the Table.HeaderRowRange and Table.TotalRowRange properties to access table header and total row ranges, and set the alignment.

    Change the width of table columns. To do this, access the table range via the Table.Range property, and use its Range.ColumnWidthInCharacters property.

  9. The image below shows the results.

Expanded See Also

Is this topic helpful?​​​​​​​