Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 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;
        
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.

Fields

Name

Description

Automatic

Excerpt Include
ItemsToRetain.Automatic
ItemsToRetain.Automatic
nopaneltrue

None

Excerpt Include
ItemsToRetain.None
ItemsToRetain.None
nopaneltrue

...

Name

Description

Max

Excerpt Include
ItemsToRetain.Max
ItemsToRetain.Max
nopaneltrue

Value

Excerpt Include
ItemsToRetain.Value
ItemsToRetain.Value
nopaneltrue

...