Interface IXLPivotCache
A cache of pivot data - essentially a collection of fields and their values that can be displayed by a IXLPivotTable. Data for the cache are retrieved from an area (a table or a range). The pivot cache data are cached, i.e. the data in the source are not immediately updated once the data in a worksheet change.
public interface IXLPivotCache
- Extension Methods
Properties
FieldNames
Get names of all fields in the source, in left to right order. Every field name is unique.
IReadOnlyList<string> FieldNames { get; }
Property Value
Remarks
The field names are case insensitive. The field names of the cached source might differ from actual names of the columns in the data cells.
ItemsToRetainPerField
Gets the number of unused items in shared items to allow before discarding unused items.
XLItemsToRetain ItemsToRetainPerField { get; set; }
Property Value
- XLItemsToRetain
Default value is Automatic.
Remarks
Shared items are distinct values of a source field values. Updating them can be expensive and this controls, when should the cache be updated. Application-dependent attribute.
RefreshDataOnOpen
Will Excel refresh the cache when it opens the workbook.
bool RefreshDataOnOpen { get; set; }
Property Value
- bool
Default value is
false.
SaveSourceData
Should the cached values of the pivot source be saved into the workbook file? If source data are not saved, they will have to be refreshed from the source reference which might cause a change in the table values.
bool SaveSourceData { get; set; }
Property Value
- bool
Default value is
true.
Methods
Refresh()
Refresh data in the pivot source from the source reference data.
IXLPivotCache Refresh()
Returns
SetItemsToRetainPerField(XLItemsToRetain)
Gets the number of unused items in shared items to allow before discarding unused items.
IXLPivotCache SetItemsToRetainPerField(XLItemsToRetain value)
Parameters
valueXLItemsToRetain
Returns
- IXLPivotCache
Default value is Automatic.
Remarks
Shared items are distinct values of a source field values. Updating them can be expensive and this controls, when should the cache be updated. Application-dependent attribute.
SetRefreshDataOnOpen()
Will Excel refresh the cache when it opens the workbook.
IXLPivotCache SetRefreshDataOnOpen()
Returns
- IXLPivotCache
Default value is
false.
Remarks
Sets the value to true.
SetRefreshDataOnOpen(bool)
Will Excel refresh the cache when it opens the workbook.
IXLPivotCache SetRefreshDataOnOpen(bool value)
Parameters
valuebool
Returns
- IXLPivotCache
Default value is
false.
SetSaveSourceData()
Should the cached values of the pivot source be saved into the workbook file? If source data are not saved, they will have to be refreshed from the source reference which might cause a change in the table values.
IXLPivotCache SetSaveSourceData()
Returns
- IXLPivotCache
Default value is
true.
Remarks
Sets the value to true.
SetSaveSourceData(bool)
Should the cached values of the pivot source be saved into the workbook file? If source data are not saved, they will have to be refreshed from the source reference which might cause a change in the table values.
IXLPivotCache SetSaveSourceData(bool value)
Parameters
valuebool
Returns
- IXLPivotCache
Default value is
true.