Wiki Markup |
---|
{introducedin: 8.4} {description} {excerpt}The ItemsToRetain class represents the number of items a PivotTable cache will retain even changes have been made to the data source.{excerpt} {signature:C#} public sealed class ItemsToRetain {signature}{signature:vb.net} Public NotInheritable Class ItemsToRetain {signature} {example}{code:csharp|title=C#} ExcelApplication xla = new ExcelApplication(); Workbook wb = xla.Open("template.xlsx"); ItemsToRetain items = wb[0].PivotTables[0].PivotTableSettings.ItemsToRetain; {code} {code:vbnet|title=vb.net} Dim xla As New ExcelApplication() Dim wb As Workbook = xla.Open("template.xlsx") Dim items As ItemsToRetain = wb(0).PivotTables(0).PivotTableSettings.ItemsToRetain; {code} {example} {fields} || Name || Description || | [Automatic|ItemsToRetain.Automatic] | {excerpt-include:ItemsToRetain.Automatic|nopanel=true} | | [None|ItemsToRetain.None] | {excerpt-include:ItemsToRetain.None|nopanel=true} | {properties} || Name || Description || | [Max|ItemsToRetain.Max] | {excerpt-include:ItemsToRetain.Max|nopanel=true} | | [Value|ItemsToRetain.Value] | {excerpt-include:ItemsToRetain.Value|nopanel=true} | {remarks} Setting {{[PivotTableSettings.ItemsToRetain]}} is the same as going to _PivotTable Options_ > _Data_ > _Retain items deleted from the data source_ and setting _Number of items to retain per field_ to *Automatic*, *Max*, *None*, or a different integer value. {remarks} |
Page History
Overview
Content Tools