Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Introducedin
8.4

...

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.

Signature
C#
C#
 public sealed class ItemsToRetain
{signature}{signature:
}
Signature
vb.net
vb.net
Public NotInheritable Class ItemsToRetain
{signature}

{example}{code:csharp|title=C#}
Example
Code Block
csharp
csharp
titleC#


          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Open("template.xlsx");
          ItemsToRetain items = wb[0].PivotTables[0].PivotTableSettings.ItemsToRetain;
        
{code} {code:vbnet|title=
Code Block
vbnet
vbnet
titlevb.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}
Fields

Name

Description

Automatic

Excerpt Include
ItemsToRetain.Automatic
ItemsToRetain.Automatic
nopaneltrue

None

Excerpt Include
ItemsToRetain.None
ItemsToRetain.None
nopaneltrue
Properties

Name

Description

Max

Excerpt Include
ItemsToRetain.Max
ItemsToRetain.Max
nopaneltrue

Value

Excerpt Include
ItemsToRetain.Value
ItemsToRetain.Value
nopaneltrue
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.