Class: HeaderRecord

Inherits:
BiffRecord show all
Defined in:
lib/surpass/biff_record.rb

Overview

This record is part of the Page Settings Block. It specifies the page header string for the current worksheet. If this record is not present or completely empty (record size is 0), the sheet does not contain a page header.

Record HEADER for non-empty page header, BIFF2-BIFF8: Offset Size Contents 0 var. Page header string

BIFF2-BIFF7:    Non-empty byte string, 8bit string
length
BIFF8: Non-empty Unicode string, 16bit string length

The header string may contain special commands, i.e. placeholders for the page number, current date, or text formatting attributes. These fields are represented by single letters (exception: font name and size, see below) with a leading ampersand (“&”). If the ampersand is part of the regular header text, it will be duplicated (“&&”). The page header is divided into 3 sections: the left, the centred, and the right section. Each section is introduced by a special command. All text and all commands following are part of the selected section. Each section starts with the text formatting specified in the default font (first FONT record in the file). Active formatting attributes from a previous section do not go into the next section.

The following table shows all available commands:

Command Contents && The “&” character itself &L Start of the left section &C Start of the centred section &R Start of the right section &P Current page number &N Page count &D Current date &T Current time &A Sheet name (BIFF5-BIFF8) &F File name without path &Z File path without file name (BIFF8X) &G Picture (BIFF8X) &B Bold on/off (BIFF2-BIFF4) &I Italic on/off (BIFF2-BIFF4) &U Underlining on/off &E Double underlining on/off (BIFF5-BIFF8) &S Strikeout on/off &X Superscript on/off (BIFF5-BIFF8) &Y Subscript on/off (BIFF5-BIFF8) &“<fontname>” Set new font <fontname> &“<fontname>,<fontstyle>”

Set new font with specified style <fontstyle>.
The style <fontstyle> is in most cases one of
"Regular", "Bold", "Italic", or "Bold Italic".
But this setting is dependent on the used font,
it may differ (localised style names, or "Standard",
"Oblique", ...). (BIFF5-BIFF8)

&<fontheight> Set font height in points (<fontheight> is a decimal value).

If this command is followed by a plain number to be printed
in the header, it will be separated from the font height
with a space character.

Constant Summary collapse

RECORD_ID =
0x0014

Constants inherited from BiffRecord

BiffRecord::BIFF_LIMIT, BiffRecord::CONTINUE_RECORD_ID

Instance Attribute Summary

Attributes inherited from BiffRecord

#record_data

Instance Method Summary collapse

Methods inherited from BiffRecord

#record_header, #to_biff

Constructor Details

#initialize(str) ⇒ HeaderRecord

Returns a new instance of HeaderRecord.



1802
1803
1804
# File 'lib/surpass/biff_record.rb', line 1802

def initialize(str)
  @record_data = [str.length, 0].pack('vC') + str
end