Class PivotCacheCollection
Represents the collection of memory caches from the PivotTable reports in a workbook.
Inheritance
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.PivotTables
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class PivotCacheCollection : ICloneParent, IPivotCaches, IEnumerable<PivotCacheImpl>, IEnumerable, IParentApplication
Constructors
PivotCacheCollection(IApplication, Object)
Initializes a new instance of pivot cache collection.
Declaration
public PivotCacheCollection(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object that represents the Excel application. |
System.Object | parent | Parent object of this collection. |
PivotCacheCollection(IApplication, Object, ICompoundStorage, IDecryptor)
Initializes a new instance of pivot cache collection with the specified cache storage and dectyptor.
Declaration
public PivotCacheCollection(IApplication application, object parent, ICompoundStorage storage, IDecryptor decryptor)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object that represents the Excel application. |
System.Object | parent | Parent object of this collection. |
ICompoundStorage | storage | Pivot caches storage. |
IDecryptor | decryptor | Object used to decrypt encrypted records. |
Fields
DEF_PIVOT_CACHE_STORAGE
Name of sub-storage in input file which contains pivot table cache data.
Declaration
public const string DEF_PIVOT_CACHE_STORAGE = "_SX_DB_CUR"
Field Value
Type | Description |
---|---|
System.String |
Properties
Application
Gets the application object. Read-only.
Declaration
public IApplication Application { get; }
Property Value
Type | Description |
---|---|
IApplication |
Count
Gets number of pivot cache items in the collection. Read-only.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
Gets a pivot cache with the specified index from the collection. Read-only.
Declaration
public PivotCacheImpl this[int id] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | Zero-based index of the cache to return. |
Property Value
Type | Description |
---|---|
PivotCacheImpl |
Order
Gets the ordered list of pivot caches. Read-only.
Declaration
public List<int> Order { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> |
Parent
Gets the parent object. Read-only.
Declaration
public object Parent { get; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
Add(PivotCacheImpl)
Adds specified cache item to the collection.
Declaration
public void Add(PivotCacheImpl cache)
Parameters
Type | Name | Description |
---|---|---|
PivotCacheImpl | cache | Item to add. |
Add(IRange)
Adds a new PivotTable cache to a PivotCaches collection.
Declaration
public IPivotCache Add(IRange range)
Parameters
Type | Name | Description |
---|---|---|
IRange | range | Range that contains data to cache. |
Returns
Type | Description |
---|---|
IPivotCache | Returns a pivot cache. |
Examples
Following code snippet illustrates how to add a pivot cache.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet worksheet = workbook.Worksheets[0];
// Create Pivot cache with the given data range
IPivotCache cache = workbook.PivotCaches.Add(worksheet["A1:H50"]);
Add(Int32, PivotCacheImpl)
Adds specified cache item to the collection at the specifed index.
Declaration
public void Add(int index, PivotCacheImpl cache)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
PivotCacheImpl | cache | Item to add. |
Clear()
Clears all the pivot caches from the collection.
Declaration
public void Clear()
Clone(Object)
Creates a new object that is a copy of the current instance.
Declaration
public object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for a copy of this instance. |
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
GetEnumerator()
Gets the IEnumerable list of pivot cache elements.
Declaration
public IEnumerator<PivotCacheImpl> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<PivotCacheImpl> |
GetIndexes()
Get Cache indexes
Declaration
public int[] GetIndexes()
Returns
Type | Description |
---|---|
System.Int32[] | cache indexes |
Parse(ICompoundStorage, IDecryptor)
Parses pivot caches storage.
Declaration
public void Parse(ICompoundStorage storage, IDecryptor decryptor)
Parameters
Type | Name | Description |
---|---|---|
ICompoundStorage | storage | Storage to parse. |
IDecryptor | decryptor | Object used to decrypt encrypted records. |
RemoveAt(Int32)
Removes the Pivot cache from the collection at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Serialize(ICompoundStorage, IEncryptor)
Serializes the pivot cache.
Declaration
public void Serialize(ICompoundStorage storage, IEncryptor encryptor)
Parameters
Type | Name | Description |
---|---|---|
ICompoundStorage | storage | Storage to serialize into. |
IEncryptor | encryptor | Object that is used to encrypt data. |
Explicit Interface Implementations
IPivotCaches.get_Item(Int32)
Declaration
IPivotCache IPivotCaches.get_Item(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id |
Returns
Type | Description |
---|---|
IPivotCache |
IPivotCaches.Item[Int32]
Returns single entry of pivot cache from the collection. Read-only.
Declaration
IPivotCache IPivotCaches.this[] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | Item id to return. |
Returns
Type | Description |
---|---|
IPivotCache | An entry from the collection. |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |