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 pivot table PivotTable cache will retain even changes have been made to the data source.

...

Example
Code Block
csharp
csharp
titleC#

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.CreateOpen("template.xlsx");
          ItemsToRetain items = wb[0].PivotTables[0].PivotTableSettings.ItemsToRetain;
        
Code Block
vbnet
vbnet
titlevb.net

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.CreateOpen("template.xlsx")
          Dim palitems As ItemsToRetain = wb[(0]).PivotTables[(0]).PivotTableSettings.ItemsToRetain;
        

...

Name

Description

Automatic

Excerpt Include
EW8:ItemsToRetain.AutomaticEW8:
ItemsToRetain.Automatic
nopaneltrue

None

Excerpt Include
EW8:ItemsToRetain.NoneEW8:
ItemsToRetain.None
nopaneltrue

...

Name

Description

Max

Excerpt Include
EW8:ItemsToRetain.MaxEW8:
ItemsToRetain.Max
nopaneltrue

Value

Excerpt Include
EW8:ItemsToRetain.ValueEW8:
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.