class Workbook extends BIFFwriter (View source)

Properties

string $_data The string containing the data of the BIFF stream. from BIFFwriter
int $_datasize The size of the data in bytes. Should be the same as strlen($this->_data). from BIFFwriter

Methods

__construct(Spreadsheet $spreadsheet, int $str_total, int $str_unique, array $str_table, array $colors, Parser $parser)

Class constructor.

static int
getByteOrder()

Determine the byte order and store it as class data to avoid recalculating it for each call to new().

append(string $data)

General storage function.

string
writeData(string $data)

General storage function like append, but returns string instead of modifying $this->_data.

storeBof(int $type)

Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file.

storeEof()

Writes Excel EOF record to indicate the end of a BIFF stream.

writeEof()

Writes Excel EOF record to indicate the end of a BIFF stream.

int
addXfWriter(Style $style, bool $isStyleXf = false)

Add a new XF writer.

int
addFont(Font $font)

Add a font to added fonts.

string
writeWorkbook(array $pWorksheetSizes)

Assemble worksheets into a workbook and send the BIFF data to an OLE storage.

getEscher()

Get Escher object.

setEscher(Escher $pValue = null)

Set Escher object.

Details

__construct(Spreadsheet $spreadsheet, int $str_total, int $str_unique, array $str_table, array $colors, Parser $parser)

Class constructor.

Parameters

Spreadsheet $spreadsheet The Workbook
int $str_total Total number of strings
int $str_unique Total number of unique strings
array $str_table String Table
array $colors Colour Table
Parser $parser The formula parser created for the Workbook

static int getByteOrder()

Determine the byte order and store it as class data to avoid recalculating it for each call to new().

Return Value

int

protected append(string $data)

General storage function.

Parameters

string $data binary data to append

string writeData(string $data)

General storage function like append, but returns string instead of modifying $this->_data.

Parameters

string $data binary data to write

Return Value

string

protected storeBof(int $type)

Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file.

Parameters

int $type type of BIFF file to write: 0x0005 Workbook, 0x0010 Worksheet

protected storeEof()

Writes Excel EOF record to indicate the end of a BIFF stream.

writeEof()

Writes Excel EOF record to indicate the end of a BIFF stream.

int addXfWriter(Style $style, bool $isStyleXf = false)

Add a new XF writer.

Parameters

Style $style
bool $isStyleXf Is it a style XF?

Return Value

int Index to XF record

int addFont(Font $font)

Add a font to added fonts.

Parameters

Font $font

Return Value

int Index to FONT record

string writeWorkbook(array $pWorksheetSizes)

Assemble worksheets into a workbook and send the BIFF data to an OLE storage.

Parameters

array $pWorksheetSizes The sizes in bytes of the binary worksheet streams

Return Value

string Binary data for workbook stream

Escher getEscher()

Get Escher object.

Return Value

Escher

setEscher(Escher $pValue = null)

Set Escher object.

Parameters

Escher $pValue