Class ExcelPivotTableFieldCollection
A collection of pivot table fields
Inheritance
Implements
Inherited Members
Namespace: OfficeOpenXml.Table.PivotTable
Assembly: EPPlus.dll
Syntax
public class ExcelPivotTableFieldCollection : ExcelPivotTableFieldCollectionBase<ExcelPivotTableField>, IEnumerable<ExcelPivotTableField>, IEnumerable
Properties
Item[String]
Indexer by name
Declaration
public ExcelPivotTableField this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name |
Property Value
Type | Description |
---|---|
ExcelPivotTableField | The pivot table field |
Methods
AddCalculatedField(String, String)
Adds a calculated field to the underlaying pivot table cache.
Declaration
public ExcelPivotTableField AddCalculatedField(string name, string formula)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The unique name of the field |
System.String | formula | The formula for the calculated field. Note: In formulas you create for calculated fields or calculated items, you can use operators and expressions as you do in other worksheet formulas. You can use constants and refer to data from the pivot table, but you cannot use cell references or defined names.You cannot use worksheet functions that require cell references or defined names as arguments, and you can not use array functions. Formula |
Returns
Type | Description |
---|---|
ExcelPivotTableField | The new calculated field |
GetDateGroupField(eDateGroupBy)
Returns the date group field.
Declaration
public ExcelPivotTableField GetDateGroupField(eDateGroupBy GroupBy)
Parameters
Type | Name | Description |
---|---|---|
eDateGroupBy | GroupBy | The type of grouping |
Returns
Type | Description |
---|---|
ExcelPivotTableField | The matching field. If none is found null is returned |
GetNumericGroupField()
Returns the numeric group field.
Declaration
public ExcelPivotTableField GetNumericGroupField()
Returns
Type | Description |
---|---|
ExcelPivotTableField | The matching field. If none is found null is returned |