Skip to main content
Row

PivotCache Interface

Represents the data cache for a PivotTable report.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public interface PivotCache

The following members return PivotCache objects:

Remarks

When you create a pivot table, it doesn’t directly work with the source data. Instead, it uses an in-memory copy of the source data called the pivot cache. A workbook may contain multiple caches of different types. All PivotCache objects are stored in the PivotCacheCollection collection, which can be accessed using the Workbook.PivotCaches property. To return a pivot cache for a specific PivotTable report, use the PivotTable.Cache property.

By default, pivot tables that are based on the same data share a pivot cache. As a result, a certain functionality (such as grouping, calculated fields and items) used in one pivot table will be automatically propagated to other reports that share the same cache.

Since pivot tables work on a snapshot of data, any changes made to the actual data source will not affect the PivotTable reports. To get the latest data from the data source, refresh the pivot cache using the PivotCache.Refresh method. All the pivot tables that are based on this cache will be refreshed.

If you wish to create a new pivot table based on the data cache of the existing PivotTable report, use the PivotTableCollection.Add method overload that accepts a PivotCache object as a parameter. For an example, refer to the How to: Create a Pivot Table article.

Important

Currently, the SpreadsheetControl can operate only with the pivot caches of the PivotCacheType.Worksheet and PivotCacheType.Consolidation types. A pivot cache with an external source is not supported.

See Also