2.4.136 Header

Office

The Header record specifies the header text of the current sheet when printed.


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

ast (variable)

...

ast (variable): An XLUnicodeString structure that specifies the header text for the current sheet. It is optional and exists only if the record size is not zero. The text appears at the top of every page when printed.  The length of the text MUST be less than or equal to 255. The header text can contain special commands, for example a placeholder for the page number, current date or text formatting attributes. Special commands are represented by single letter with a leading ampersand ("&"). The following ABNF lists the possible commands and how they are used:

ABNF Grammar for Header and Footer Strings                  

headerfooter = *(left / pagenum / pagetotal / fontsize / strikethrough / superscript / subscript / center / date / time / filepath / picture / underline / doubleunderline / right / bookpath / sheetname / fontname / fonttype / font / bold / italic / ampersand / emptytoken / UNICHAR)

UNICHAR = %x0020-FFFF

This code specifies Unicode characters, starting with the space character (%x0020).

DIGIT = %x0030-0039

This code specifies a digit between 0 and 9.

HEXALPHA = %x0041-0046 / %x0061-0066

This code specifies a character between A and F or between a and f.

DQUOTE = %x0022

This code specifies a double quotation mark.

left = "&L"

This code specifies the beginning of the left section. There are three header and footer sections: left, center, and right. When two or more of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the left section.

pagenum = "&P"

This code specifies the current page number.

pagetotal = "&N" 0*1(("-" / "+") *DIGIT)

This code specifies the total number of pages.

fontsize = "&" 1*3DIGIT

This code specifies the text font size, where font size is measured in points.

strikethrough = "&S"

This code specifies whether the strikethrough text style is on or off. The first occurrence of this code MUST turn the strikethrough text style on, and the second occurrence MUST turn it off.

superscript = "&X"

This code specifies whether the superscript text style is on or off. The first occurrence of this code MUST turn the superscript text style on, and the second occurrence MUST turn it off. The superscript and subscript codes MUST NOT both be on at same time. If both codes occur in the string, the code that occurs first is applied and the other is ignored.

subscript = "&Y"

This code specifies whether the subscript text style is on or off. The first occurrence of this code MUST turn the subscript text style on, and the second occurrence MUST turn it off. The superscript and subscript codes MUST NOT both be on at same time. If both codes occur in the string, the code that occurs first is applied and the other is ignored.

center = "&C"

This code specifies the beginning of the center section. When two or more of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the center section.

date = "&D"

This code specifies a date.

time = "&T"

This code specifies a time.

picture = "&G"

This code specifies a picture.

underline = "&U"

This code specifies whether the single underline text style is on or off. The first occurrence of this code MUST turn the underline text style on, and the second occurrence MUST turn it off.

doubleunderline = "&E"

This code specifies whether the double underline text style is on or off. The first occurrence of this code MUST turn the double underline text style on, and the second occurrence MUST turn it off.

right = "&R"

This code specifies the beginning of the right section. When two or more of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the right section.

bookpath = "&Z"

This code specifies a workbook file path.

bookname = "&F"

This code specifies a workbook file name.

sheetname = "&A"

This code specifies a sheet name.

fontname = (1*UNICHAR / "-")

This code specifies the text font name. When the font name is a hyphen, no font is specified. This can be a localized string.

fonttype = ("italic" / "bold" / "regular" / "italic bold" / "bold italic")

This code specifies the text font type. This can be a localized string.

font = "&" DQUOTE fontname , fonttype DQUOTE

This code specifies the text font.

bold = "&B"

This code specifies whether the bold text style is on or off. The first occurrence of this code MUST turn the bold text style on, and the second occurrence MUST turn it off.

italic = "&I"

This code specifies whether the italic text style is on or off. The first occurrence of this code MUST turn the italic text style on, and the second occurrence MUST turn it off.

ampersand = "&&"

This code specifies an ampersand character.

emptytoken = "&" *1UNICHAR

This code specifies an unidentified token. If just "&" appears, or if there is a UNICHAR specified after "&" and it is not one of the UNICHAR characters listed in the preceding rules, then the token is interpreted as empty and nothing is rendered in the header or footer text.

Show: