Moodle  2.2.1
http://www.collinsharper.com
Spreadsheet_Excel_Writer_Workbook Class Reference
Inheritance diagram for Spreadsheet_Excel_Writer_Workbook:
Collaboration diagram for Spreadsheet_Excel_Writer_Workbook:

Public Member Functions

 Spreadsheet_Excel_Writer_Workbook ($filename)
 close ()
 sheets ()
 worksheets ()
 setVersion ($version)
 setCountry ($code)
addWorksheet ($name= '')
addFormat ($properties=array())
addValidator ()
 setCustomColor ($index, $red, $green, $blue)
 _setPaletteXl97 ()
 _storeWorkbook ()
 setTempDir ($dir)
 _storeOLEFile ()
 _calcSheetOffsets ()
 _storeAllFonts ()
 _storeAllNumFormats ()
 _storeAllXfs ()
 _storeAllStyles ()
 _storeExterns ()
 _storeNames ()
 _storeCodepage ()
 _storeWindow1 ()
 _storeBoundsheet ($sheetname, $offset)
 _storeSupbookInternal ()
 _storeExternsheetBiff8 ()
 _storeStyle ()
 _storeNumFormat ($format, $ifmt)
 _storeDatemode ()
 _storeExterncount ($cxals)
 _storeExternsheet ($sheetname)
 _storeNameShort ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 _storeNameLong ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 _storeCountry ()
 _storePalette ()
 _calculateSharedStringsSizes ()
 _storeSharedStringsTable ()

Data Fields

 $_filename
 $_parser
 $_1904
 $_activesheet
 $_firstsheet
 $_selected
 $_xf_index
 $_fileclosed
 $_biffsize
 $_sheetname
 $_tmp_format
 $_worksheets
 $_sheetnames
 $_formats
 $_palette
 $_url_format
 $_codepage
 $_country_code
 $_tmp_dir
 $_string_sizeinfo_size

Detailed Description

Definition at line 50 of file Workbook.php.


Member Function Documentation

Calculate offsets for Worksheet BOF records.

private

Definition at line 620 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Calculate Handling of the SST continue blocks is complicated by the need to include an additional continuation byte depending on whether the string is split between blocks or whether it starts at the beginning of the block. (There are also additional complications that will arise later when/if Rich Strings are supported).

MOODLE NOTE!!

The functions below _calculateSharedStringsSizes() _storeSharedStringsTable() have been inserted, replacing the original functions in order to make the function work with 2-byte data. The patch is discussed at this URL: http://pear.php.net/bugs/bug.php?id=1572 and documented for Moodle at: http://tracker.moodle.org/browse/MDL-9911 --Tom Robb, trobb@cc.kyoto-su.ac.jp July 23, 2007

private

Definition at line 1319 of file Workbook.php.

Here is the caller graph for this function:

Sets the colour palette to the Excel 97+ default.

private

Definition at line 427 of file Workbook.php.

Here is the caller graph for this function:

Store the Excel FONT records.

private

Definition at line 659 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Store user defined numerical formats i.e. FORMAT records

private

Definition at line 703 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write all STYLE records.

private

Definition at line 778 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write all XF records.

private

Definition at line 751 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_storeBoundsheet ( sheetname,
offset 
)

Writes Excel BIFF BOUNDSHEET record. FIXME: inconsistent with BIFF documentation

Parameters:
string$sheetnameWorksheet name
integer$offsetLocation of worksheet BOF private

Definition at line 935 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Stores the CODEPAGE biff record.

private

Definition at line 885 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Stores the COUNTRY record for localization

private

Definition at line 1261 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write DATEMODE record to indicate the date system in use (1904 or 1900).

private

Definition at line 1047 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_storeExterncount ( cxals)

Write BIFF record EXTERNCOUNT to indicate the number of external sheet references in the workbook.

Excel only stores references to external sheets that are used in NAME. The workbook NAME record is required to define the print area and the repeat rows and columns.

A similar method is used in Worksheet.php for a slightly different purpose.

Parameters:
integer$cxalsNumber of external references private

Definition at line 1073 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write the EXTERNCOUNT and EXTERNSHEET records. These are used as indexes for the NAME records.

private

Definition at line 789 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_storeExternsheet ( sheetname)

Writes the Excel BIFF EXTERNSHEET record. These references are used by formulas. NAME record is required to define the print area and the repeat rows and columns.

A similar method is used in Worksheet.php for a slightly different purpose.

Parameters:
string$sheetnameWorksheet name private

Definition at line 1094 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Writes the Excel BIFF EXTERNSHEET record. These references are used by formulas.

Parameters:
string$sheetnameWorksheet name private

Definition at line 978 of file Workbook.php.

Here is the call graph for this function:

_storeNameLong ( index,
type,
rowmin,
rowmax,
colmin,
colmax 
)

Store the NAME record in the long format that is used for storing the repeat rows and columns when both are specified. This shares a lot of code with _storeNameShort() but we use a separate method to keep the code clean. Code abstraction for reuse can be carried too far, and I should know. ;-)

Parameters:
integer$indexSheet index
integer$typeBuilt-in name type
integer$rowminStart row
integer$rowmaxEnd row
integer$colminStart colum
integer$colmaxEnd column private

Definition at line 1186 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write the NAME record to define the print area and the repeat rows and cols.

private

Definition at line 805 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_storeNameShort ( index,
type,
rowmin,
rowmax,
colmin,
colmax 
)

Store the NAME record in the short format that is used for storing the print area, repeat rows only and repeat columns only.

Parameters:
integer$indexSheet index
integer$typeBuilt-in name type
integer$rowminStart row
integer$rowmaxEnd row
integer$colminStart colum
integer$colmaxEnd column private

Definition at line 1120 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_storeNumFormat ( format,
ifmt 
)

Writes Excel FORMAT record for non "built-in" numerical formats.

Parameters:
string$formatCustom format string
integer$ifmtFormat index code private

Definition at line 1020 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Store the workbook in an OLE container

private

Returns:
mixed true on success. PEAR_Error on failure

Definition at line 584 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Stores the PALETTE biff record.

private

Definition at line 1277 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write all of the workbooks strings into an indexed array. See the comments in _calculate_shared_string_sizes() for more information.

The Excel documentation says that the SST record should be followed by an EXTSST record. The EXTSST record is a hash table that is used to optimise access to SST. However, despite the documentation it doesn't seem to be required so we will ignore it.

private

Definition at line 1466 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write Excel BIFF STYLE records.

private

Definition at line 998 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write Internal SUPBOOK record

private

Definition at line 961 of file Workbook.php.

Here is the call graph for this function:

Write Excel BIFF WINDOW1 record.

private

Definition at line 902 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

private

Returns:
mixed true on success. PEAR_Error on failure

Definition at line 496 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

& addFormat ( properties = array())

Add a new format to the Excel workbook. Also, pass any properties to the Format constructor.

public

Parameters:
array$propertiesarray with properties for initializing the format.
Returns:
&Spreadsheet_Excel_Writer_Format reference to an Excel Format

Definition at line 362 of file Workbook.php.

Here is the caller graph for this function:

& addValidator ( )

Create new validator.

public

Returns:
&Spreadsheet_Excel_Writer_Validator reference to a Validator

Definition at line 376 of file Workbook.php.

& addWorksheet ( name = '')

Add a new worksheet to the Excel workbook. If no name is given the name of the worksheet will be Sheeti$i, with $i in [1..].

public

Parameters:
string$namethe optional name of the worksheet
Returns:
mixed reference to a worksheet object on success, PEAR_Error on failure

Definition at line 316 of file Workbook.php.

Here is the call graph for this function:

close ( )

Calls finalization methods. This method should always be the last one to be called on every workbook

public

Returns:
mixed true on success. PEAR_Error on failure

Definition at line 220 of file Workbook.php.

Here is the call graph for this function:

setCountry ( code)

Set the country identifier for the workbook

public

Parameters:
integer$codeIs the international calling country code for the chosen country.

Definition at line 301 of file Workbook.php.

setCustomColor ( index,
red,
green,
blue 
)

Change the RGB components of the elements in the colour palette.

public

Parameters:
integer$indexcolour index
integer$redred RGB value [0-255]
integer$greengreen RGB value [0-255]
integer$blueblue RGB value [0-255]
Returns:
integer The palette index for the custom color

Definition at line 394 of file Workbook.php.

Here is the call graph for this function:

setTempDir ( dir)

Sets the temp dir used for storing the OLE file

public

Parameters:
string$dirThe dir to be used as temp dir
Returns:
true if given dir is valid, false otherwise

Definition at line 569 of file Workbook.php.

setVersion ( version)

Sets the BIFF version. This method exists just to access experimental functionality from BIFF8. It will be deprecated ! Only possible value is 8 (Excel 97/2000). For any other value it fails silently.

public

Parameters:
integer$versionThe BIFF version

Definition at line 269 of file Workbook.php.

sheets ( )

An accessor for the _worksheets[] array Returns an array of the worksheet objects in a workbook It actually calls to worksheets()

public

See also:
worksheets()
Returns:
array

Definition at line 242 of file Workbook.php.

Here is the call graph for this function:

Class constructor

Parameters:
stringfilename for storing the workbook. "-" for writing to stdout. public

Definition at line 180 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

An accessor for the _worksheets[] array. Returns an array of the worksheet objects in a workbook

public

Returns:
array

Definition at line 254 of file Workbook.php.

Here is the caller graph for this function:


Field Documentation

$_1904

Definition at line 68 of file Workbook.php.

$_activesheet

Definition at line 74 of file Workbook.php.

$_biffsize

Definition at line 106 of file Workbook.php.

$_codepage

Definition at line 154 of file Workbook.php.

$_country_code

Definition at line 160 of file Workbook.php.

$_fileclosed

Definition at line 99 of file Workbook.php.

$_filename

Definition at line 56 of file Workbook.php.

$_firstsheet

Definition at line 80 of file Workbook.php.

$_formats

Definition at line 136 of file Workbook.php.

$_palette

Definition at line 142 of file Workbook.php.

$_parser

Definition at line 62 of file Workbook.php.

$_selected

Definition at line 86 of file Workbook.php.

$_sheetname

Definition at line 112 of file Workbook.php.

$_sheetnames

Definition at line 130 of file Workbook.php.

$_string_sizeinfo_size

Definition at line 172 of file Workbook.php.

$_tmp_dir

Definition at line 166 of file Workbook.php.

$_tmp_format

Definition at line 118 of file Workbook.php.

$_url_format

Definition at line 148 of file Workbook.php.

$_worksheets

Definition at line 124 of file Workbook.php.

$_xf_index

Definition at line 92 of file Workbook.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations