Edytuj

Udostępnij za pośrednictwem


PivotField.IncludeNewItemsInFilter Property

Definition

Allows developers to specify whether excluded or included items should be tracked when manual filtering is applied to the PivotField. Read/write.

public:
 property bool IncludeNewItemsInFilter { bool get(); void set(bool value); };
public bool IncludeNewItemsInFilter { get; set; }
Public Property IncludeNewItemsInFilter As Boolean

Property Value

Boolean

Remarks

The default value for this property is False.

When manual filtering is applied, developers can set the IncludeNewItemsInFilter property to True to track excluded items. They can set the property to False to track included items.

If new items are added to the source data after the IncludeNewItemsInFilter property is set to True, the new items appear in the PivotTable after the next refresh operation because they are not in the collection of items that Excel is tracking.

For OLAP hierarchies this setting is set on the CubeField object, and trying to set it on PivotFields that are part of a hierarchy will fail (with a run-time error). You can get this setting from the PivotFields that are part of a hierarchy and it will return the same as the corresponding IncludeNewItemsInFilter property.

Toggling this setting will clear the following collections: HiddenItemsList, HiddenItems[Object], VisibleItemsList, and VisibleItems[Object].

When IncludeNewItemsInFilter is set to False, the HiddenItemsList and HiddenItems[Object] collections are empty and items cannot be added to them. A run-time error is returned when attempting to add items.

When IncludeNewItemsInFilter is set to True, the VisibleItemsList and VisibleItems[Object] collections are empty and items cannot be added to them. A run-time error is returned when attempting to add items.

In PivotTables, this setting is set on the PivotField object. Toggling this setting will not change the filter state.

Applies to