2.5.73 HeaderFooterString
The HeaderFooterString structure is an XLNullableWideString (section 2.5.167) structure that specifies a header or footer string. The length of the string MUST be less than or equal to 255. Characters within the string MUST be interpreted through the following ABNF grammar for header and footer strings.
The following grammar specifies Unicode characters, starting with the space character (%x0020).
headerfooter = *(left / pagenum / pagetotal / fontsize / strikethrough / superscript / subscript / center / date / time / picture / underline / doubleunderline / right / bookpath / bookname / sheetname / fontname / fonttype / font / bold / italic / ampersand / emptytoken / UNICHAR)
UNICHAR = %x0020-FFFF
The following grammar specifies a digit between 0 and 9.
DIGIT = %x0030-0039
The following grammar specifies a character between A and F or between a and f.
HEXALPHA = %x0041-0046 / %x0061-0066
The following grammar specifies a double quotation mark.
DQUOTE = %x0022
The following grammar specifies the beginning of the left section. There are three header and footer sections: left, center, and right. When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the left section.
left = "&L"
The following grammar specifies the current page number.
pagenum = "&P"
The following grammar specifies the total number of pages.
pagetotal = "&N" 0*1(("-" / "+") *DIGIT)
The following grammar specifies the text font size, where font size is measured in points.
fontsize = "&" 1*3DIGIT
The following grammar specifies whether the strikethrough text style is on or off. The first occurrence of this grammar MUST turn the strikethrough text style on, and the second occurrence MUST turn it off.
strikethrough = "&S"
The following grammar specifies whether the superscript text style is on or off. The first occurrence of this grammar MUST turn the superscript text style on, and the second occurrence MUST turn it off. The superscript and subscript grammar MUST NOT be on at same time. If both occur in the string, the grammar that occurs first is applied and the second is ignored.
superscript = "&X"
The following grammar specifies whether the subscript text style is on or off. The first occurrence of this grammar MUST turn the subscript text style on, and the second occurrence MUST turn it off. The superscript and subscript grammar MUST NOT be on at same time. If both occur in the string, the grammar that occurs first is applied and the second is ignored.
subscript = "&Y"
The following grammar specifies the beginning of the center section. When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the center section.
center = "&C"
The following grammar specifies a date.
date = "&D"
The following grammar specifies a time.
time = "&T"
The following grammar specifies a picture.
picture = "&G"
The following grammar specifies whether the single underline text style is on or off. The first occurrence of this grammar MUST turn the underline text style on, and the second occurrence MUST turn it off.
underline = "&U"
The following grammar specifies whether the double underline text style is on or off. The first occurrence of this grammar MUST turn the double underline text style on, and the second occurrence MUST turn it off.
doubleunderline = "&E"
The following grammar specifies the beginning of the right section. When two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the order of appearance, and placed into the right section.
right = "&R"
The following grammar specifies a workbook file path.
bookpath = "&Z"
The following grammar specifies a workbook file name.
bookname = "&F"
The following grammar specifies a sheet name.
sheetname = "&A"
The following grammar specifies the text font name. When the font name is a hyphen, no font is specified. This can be a localized string.
fontname = (1*UNICHAR / "-")
The following grammar specifies the text font type. This can be a localized string.
fonttype = ("italic" / "bold" / "regular" / "italic bold" / "bold italic")
The following grammar specifies the text font.
font = "&" DQUOTE fontname , fonttype DQUOTE
The following grammar 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.
bold = "&B"
The following grammar 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.
italic = "&I"
The following grammar specifies an ampersand character.
ampersand = "&&"
The following grammar specifies an unidentified token. If only "&" appears, or if there is a UNICHAR character specified after "&" and it is not one of the UNICHAR characters listed in the preceding rules, the token is interpreted as empty and nothing is rendered in the header or footer text.
emptytoken = "&" *1UNICHAR