Table of Contents

Class ExcelPivotTableField

Namespace
OfficeOpenXml.Table.PivotTable
Assembly
EPPlus.dll

A pivot table field.

public class ExcelPivotTableField : XmlHelper
Inheritance
ExcelPivotTableField
Inherited Members

Properties

AutoSort

Auto sort for a field. Sort is set on a data field for a row/column field. Use SetAutoSort(ExcelPivotTableDataField, eSortType) to set auto sort Use RemoveAutoSort() to remove auto sort and set this property to null

public ExcelPivotAreaAutoSort AutoSort { get; }

Property Value

ExcelPivotAreaAutoSort

Axis

Type of axis

public ePivotFieldAxis Axis { get; }

Property Value

ePivotFieldAxis

Cache

A reference to the cache for the pivot table field.

public ExcelPivotTableCacheField Cache { get; set; }

Property Value

ExcelPivotTableCacheField

Compact

Compact mode

public bool Compact { get; set; }

Property Value

bool

Filters

Filters used on the pivot table field.

public ExcelPivotTableFieldFilterCollection Filters { get; }

Property Value

ExcelPivotTableFieldFilterCollection

Format

The numberformat to use for the column

public string Format { get; set; }

Property Value

string

Grouping

Grouping settings. Null if the field has no grouping otherwise ExcelPivotTableFieldDateGroup or ExcelPivotTableFieldNumericGroup.

public ExcelPivotTableFieldGroup Grouping { get; }

Property Value

ExcelPivotTableFieldGroup

IncludeNewItemsInFilter

A boolean that indicates whether manual filter is in inclusive mode

public bool IncludeNewItemsInFilter { get; set; }

Property Value

bool

Index

The index of the pivot table field

public int Index { get; set; }

Property Value

int

IsColumnField

If the field is a column field

public bool IsColumnField { get; }

Property Value

bool

IsDataField

If the field is a datafield

public bool IsDataField { get; set; }

Property Value

bool

IsPageField

If the field is a page field.

public bool IsPageField { get; }

Property Value

bool

IsRowField

If the field is a row field

public bool IsRowField { get; }

Property Value

bool

Items

Pivottable field Items. Used for grouping.

public ExcelPivotTableFieldItemsCollection Items { get; }

Property Value

ExcelPivotTableFieldItemsCollection

MultipleItemSelectionAllowed

Indicates whether the field can have multiple items selected in the page field

public bool MultipleItemSelectionAllowed { get; set; }

Property Value

bool

Name

Name of the field

public string Name { get; set; }

Property Value

string

Outline

A boolean that indicates whether the items in this field should be shown in Outline form

public bool Outline { get; set; }

Property Value

bool

PageFieldSettings

Page field settings

public ExcelPivotTablePageFieldSettings PageFieldSettings { get; }

Property Value

ExcelPivotTablePageFieldSettings

ShowAll

Indicates whether to show all items for this field

public bool ShowAll { get; set; }

Property Value

bool

ShowAsCaption

Indicates whether to show the property as a member caption

public bool ShowAsCaption { get; set; }

Property Value

bool

ShowDropDowns

Indicates whether to hide drop down buttons on PivotField headers

public bool ShowDropDowns { get; set; }

Property Value

bool

ShowInFieldList

Indicates whether this hierarchy is omitted from the field list

public bool ShowInFieldList { get; set; }

Property Value

bool

ShowMemberPropertyInCell

Indicates whether to show the member property value in a PivotTable cell

public bool ShowMemberPropertyInCell { get; set; }

Property Value

bool

ShowMemberPropertyToolTip

Indicates whether to show the member property value in a tooltip on the appropriate PivotTable cells

public bool ShowMemberPropertyToolTip { get; set; }

Property Value

bool

Slicer

A slicer attached to the pivot table field. If the field has multiple slicers attached, the first slicer will be returned.

public ExcelPivotTableSlicer Slicer { get; }

Property Value

ExcelPivotTableSlicer

Sort

The type of sort that is applied to this field

public eSortType Sort { get; set; }

Property Value

eSortType

SubTotalFunctions

Enumeration of the different subtotal operations that can be applied to page, row or column fields

public eSubTotalFunctions SubTotalFunctions { get; set; }

Property Value

eSubTotalFunctions

SubtotalTop

The custom text that is displayed for the subtotals label

public bool SubtotalTop { get; set; }

Property Value

bool

Methods

AddDateGrouping(eDateGroupBy)

Add a date grouping on this field.

public void AddDateGrouping(eDateGroupBy groupBy)

Parameters

groupBy eDateGroupBy

Group by

AddDateGrouping(eDateGroupBy, DateTime, DateTime)

Add a date grouping on this field.

public void AddDateGrouping(eDateGroupBy groupBy, DateTime startDate, DateTime endDate)

Parameters

groupBy eDateGroupBy

Group by

startDate DateTime

Fixed start date. Use DateTime.MinValue for auto

endDate DateTime

Fixed end date. Use DateTime.MaxValue for auto

AddDateGrouping(int, DateTime, DateTime)

Add a date grouping on this field.

public void AddDateGrouping(int days, DateTime startDate, DateTime endDate)

Parameters

days int

Number of days when grouping on days

startDate DateTime

Fixed start date. Use DateTime.MinValue for auto

endDate DateTime

Fixed end date. Use DateTime.MaxValue for auto

AddNumericGrouping(double, double, double)

Add numberic grouping to the field

public void AddNumericGrouping(double Start, double End, double Interval)

Parameters

Start double

Start value

End double

End value

Interval double

Interval

AddSlicer()

Will add a slicer to the pivot table field

public ExcelPivotTableSlicer AddSlicer()

Returns

ExcelPivotTableSlicer

The Slicer/>

RemoveAutoSort()

Remove auto sort and set the AutoSort property to null

public void RemoveAutoSort()

SetAutoSort(ExcelPivotTableDataField, eSortType)

Set auto sort on a data field for this field.

public void SetAutoSort(ExcelPivotTableDataField dataField, eSortType sortType = eSortType.Ascending)

Parameters

dataField ExcelPivotTableDataField

The data field to sort on

sortType eSortType

Sort ascending or descending