2.4.6 AutoFilter

The AutoFilter record specifies an AutoFilter. An Lbl record (section 2.4.150) where the Name field has a value of 0x0D (_FilterDatabase) MUST exist for the current sheet (1). The rgce.rgce field of the Lbl record (section 2.4.150) MUST consist of a single PtgArea3d operand (section 2.5.198.28).)


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

iEntry

A

B

C

D

E

F

wTopN

doper1

...

...

doper2

...

...

str1 (variable)

...

str2 (variable)

...

iEntry (2 bytes): An unsigned integer that specifies the sheet (1) column that this AutoFilter applies to. The column index is determined by the following formula:

((the area.columnFirst field of the PtgArea3d (section 2.5.198.28) in the rgce.rgce field of the Lbl record (section 2.4.150) where the Name field is equal to 0x0D (_FilterDatabase) and the Lbl record (section 2.4.150) is for the current sheet (1)) + iEntry).

The value of iEntry MUST be less than the cEntries field of the proceeding AutoFilterInfo record (section 2.4.8).

A - wJoin (2 bits): A Boolean (section 2.5.14) that specifies whether doper1 and doper2 are combined using a logical AND operation or a logical OR operation. MUST be a value from the following table:

Value

Meaning

0

doper1 and doper2 are combined using a logical AND operation.

1

doper1 and doper2 are combined using a logical OR operation.

If fTopN is 1, wJoin is undefined and MUST be ignored.

B - fSimple1 (1 bit): A bit that specifies whether an application-specific performance optimization can be used to compute this AutoFilter. MUST be 1 if and only if doper1.vt is 0x06 and doper1.vtValue is not a regular expression string, or doper1.vt is 0x0C, or doper1.vt is 0x0E. If fTopN is 1, fSimple1 is undefined and MUST be ignored.

C - fSimple2 (1 bit): A bit that specifies whether an application-specific performance optimization can be used to compute this AutoFilter. MUST be 1 if and only if doper2.vt is 0x06 and doper2.vtValue is not a regular expression string, or doper2.vt is 0x0C, or doper2.vt is 0x0E. If fTopN is 1, fSimple2 is undefined and MUST be ignored.

D - fTopN (1 bit): A bit that specifies whether the AutoFilter is a Top N filter.

E - fTop (1 bit): A bit that specifies whether the Top N filter selects the bottom items or the top items. MUST be a value from the following table:

Value

Meaning

0

Top N filter selects the bottom items.

1

Top N filter selects the top items.

If fTopN is 0, fTop is undefined and MUST be ignored.

F - fPercent (1 bit): A bit that specifies whether the Top N filter selects a count of items or a percent of items. MUST be a value from the following table:

Value

Meaning

0

Top N filter selects a count of items.

1

Top N filter selects a percent of items.

If fTopN is 0, fPercent is undefined and MUST be ignored.

wTopN (9 bits): An unsigned integer that specifies the number of Top N filter items to show. If fTopN is 0, wTopN MUST be ignored. If fTopN is 1, wTopN MUST be greater than or equal to 1 and less than or equal to 500.

doper1 (10 bytes): An AFDOper structure (section 2.5.5) that specifies the first AutoFilter condition. If fTopN is 1, doper1 is undefined and MUST be ignored.

doper2 (10 bytes): An AFDOper structure (section 2.5.5) that specifies the second AutoFilter condition. If fTopN is 1, doper2 is undefined and MUST be ignored.

str1 (variable): An optional XLUnicodeStringNoCch structure (section 2.5.296) that specifies the string comparison constant for doper1. MUST exist if and only if doper1.vt is equal to 0x06. The length MUST be equal to doper1.vtValue.cch.

str2 (variable): An optional XLUnicodeStringNoCch structure (section 2.5.296) that specifies the string comparison constant for doper2. MUST exist if and only if doper2.vt is equal to 0x06. The length MUST be equal to doper2.vtValue.cch.