PivotFilter.Order Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the evaluation order of the filter among all Value filters applied to the entire PivotTable. Read/write
public:
property int Order { int get(); void set(int value); };
public int Order { get; set; }
Public Property Order As Integer
Property Value
Integer.
Remarks
This property is valid only for Value and Topn
type PivotFilters. A run-time error is returned if an attempt is made to set or get this property for Label and Date filters. 1 represents the first filter evaluated, 2 represents the next filter evaluated, and so on, until the n
th value is reached. -1 represents an inactive filter.
If the Order property is not specified when a new filter is added, it will be set to N+1
(where N
is the current highest Order number in the filter collection).
The property can be specified in the Microsoft.Office.Interop.Excel.PivotFilters.Add method or it can be set later for a field by changing the property.
Increasing the evaluation order for a field will decrease the evaluation order of the field previously holding that evaluation order value—and all fields in between the two fields—by one. Setting the evaluation order to the same as before will have no effect. Decreasing the evaluation order for a field will increase the evaluation order of the field previously holding that evaluation order value—and all fields in between the two fields—by one.
The order of PivotFilters in the collection is the same as the order in which they are evaluated. So developers can change the order in which a PivotField is evaluated. When a PivotField (non-OLAP PivotTables) or a CubeField (OLAP PivotTables) is removed from the PivotTables collection, this property is set to -1 for a Value or a Top n
filter applied to the field. Adding the field back again will set the Order property to N+1
for a Value or Top n
filter applied if a value is not explicitly specified.