Class ExcelPivotTableCollection
- Namespace
- OfficeOpenXml.Table.PivotTable
- Assembly
- EPPlus.dll
A collection of pivottable objects
public class ExcelPivotTableCollection : IEnumerable<ExcelPivotTable>, IEnumerable
- Inheritance
-
ExcelPivotTableCollection
- Implements
- Inherited Members
Properties
Count
Number of items in the collection
public int Count { get; }
Property Value
this[int]
The pivottable Index. Base 0.
public ExcelPivotTable this[int Index] { get; }
Parameters
Indexint
Property Value
this[string]
Pivottabes accesed by name
public ExcelPivotTable this[string Name] { get; }
Parameters
NamestringThe name of the pivottable
Property Value
- ExcelPivotTable
The Pivotable. Null if the no match is found
Methods
Add(ExcelAddressBase, ExcelRangeBase, string)
Create a pivottable on the supplied range
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelRangeBase Source, string Name)
Parameters
RangeExcelAddressBaseThe range address including header and total row
SourceExcelRangeBaseThe Source data range address
NamestringThe name of the pivottable. Must be unique
Returns
- ExcelPivotTable
The pivottable object
Add(ExcelAddressBase, ExcelTable, string)
Create a pivottable on the supplied range
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelTable Source, string Name)
Parameters
RangeExcelAddressBaseThe range address including header and total row
SourceExcelTableThe source table
NamestringThe name of the pivottable. Must be unique
Returns
- ExcelPivotTable
The pivottable object
Add(ExcelAddressBase, ExcelPivotCacheDefinition, string)
Create a pivottable on the supplied range
public ExcelPivotTable Add(ExcelAddressBase Range, ExcelPivotCacheDefinition PivotCacheDefinition, string Name)
Parameters
RangeExcelAddressBaseThe range address including header and total row
PivotCacheDefinitionExcelPivotCacheDefinitionA pivot table cache shared with another pivot table
NamestringThe name of the pivottable. Must be unique
Returns
- ExcelPivotTable
The pivottable object
Calculate(bool)
Calculate all pivot tables in the collection. Also see Calculate(bool) and CalculateAllPivotTables(bool)
public void Calculate(bool refresh = false)
Parameters
refreshboolIf the cache should be refreshed.
Delete(ExcelPivotTable, bool)
Delete the supplied pivot table
public void Delete(ExcelPivotTable PivotTable, bool ClearRange = false)
Parameters
PivotTableExcelPivotTableThe PivotTable to remove from the collection
ClearRangeboolClear the table range
Delete(int, bool)
Delete the pivot table at the specified index
public void Delete(int Index, bool ClearRange = false)
Parameters
Delete(string, bool)
Delete the pivottable with the supplied name
public void Delete(string Name, bool ClearRange = false)
Parameters
GetEnumerator()
Gets the enumerator of the collection
public IEnumerator<ExcelPivotTable> GetEnumerator()
Returns
- IEnumerator<ExcelPivotTable>
The enumerator