Class ExcelPivotTableCollection
A collection of pivottable objects
Inheritance
Inherited Members
Namespace: OfficeOpenXml.Table.PivotTable
Assembly: EPPlus.dll
Syntax
public class ExcelPivotTableCollection : IEnumerable<ExcelPivotTable>, IEnumerable
Properties
Count
Number of items in the collection
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
The pivottable Index. Base 0.
Declaration
public ExcelPivotTable this[int Index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index |
Property Value
Type | Description |
---|---|
ExcelPivotTable |
Item[String]
Pivottabes accesed by name
Declaration
public ExcelPivotTable this[string Name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the pivottable |
Property Value
Type | Description |
---|---|
ExcelPivotTable | The Pivotable. Null if the no match is found |
Methods
Add(ExcelAddressBase, ExcelRangeBase, String)
Create a pivottable on the supplied range
Declaration
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelRangeBase Source, string Name)
Parameters
Type | Name | Description |
---|---|---|
ExcelAddressBase | Range | The range address including header and total row |
ExcelRangeBase | Source | The Source data range address |
System.String | Name | The name of the pivottable. Must be unique |
Returns
Type | Description |
---|---|
ExcelPivotTable | The pivottable object |
Add(ExcelAddressBase, ExcelTable, String)
Create a pivottable on the supplied range
Declaration
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelTable Source, string Name)
Parameters
Type | Name | Description |
---|---|---|
ExcelAddressBase | Range | The range address including header and total row |
ExcelTable | Source | The source table |
System.String | Name | The name of the pivottable. Must be unique |
Returns
Type | Description |
---|---|
ExcelPivotTable | The pivottable object |
Add(ExcelAddressBase, ExcelPivotCacheDefinition, String)
Create a pivottable on the supplied range
Declaration
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelPivotCacheDefinition PivotCacheDefinition, string Name)
Parameters
Type | Name | Description |
---|---|---|
ExcelAddressBase | Range | The range address including header and total row |
ExcelPivotCacheDefinition | PivotCacheDefinition | A pivot table cache shared with another pivot table |
System.String | Name | The name of the pivottable. Must be unique |
Returns
Type | Description |
---|---|
ExcelPivotTable | The pivottable object |
Delete(ExcelPivotTable, Boolean)
Delete the supplied pivot table
Declaration
public void Delete(ExcelPivotTable PivotTable, bool ClearRange = false)
Parameters
Type | Name | Description |
---|---|---|
ExcelPivotTable | PivotTable | The PivotTable to remove from the collection |
System.Boolean | ClearRange | Clear the table range |
Delete(Int32, Boolean)
Delete the pivot table at the specified index
Declaration
public void Delete(int Index, bool ClearRange = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index | The index in the PivotTable collection |
System.Boolean | ClearRange | Clear the table range |
Delete(String, Boolean)
Delete the pivottable with the supplied name
Declaration
public void Delete(string Name, bool ClearRange = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the pivottable |
System.Boolean | ClearRange | Clear the table range |
GetEnumerator()
Gets the enumerator of the collection
Declaration
public IEnumerator<ExcelPivotTable> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ExcelPivotTable> | The enumerator |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |