Moodle  2.2.1
http://www.collinsharper.com
Workbook Class Reference

Public Member Functions

 Workbook ($filename)
 close ()
 sheets ()
 worksheets ()
add_worksheet ($name= '')
addworksheet ($name= '')
add_format ($properties=array())
addformat ($properties=array())
 set_custom_color ($index, $red, $green, $blue)
 _set_palette_xl97 ()
 store_workbook ()
 _store_OLE_file ()
 _calc_sheet_offsets ()
 _store_all_fonts ()
 _store_all_num_formats ()
 _store_all_xfs ()
 _store_all_styles ()
 _store_externs ()
 _store_names ()
 _store_window1 ()
 _store_boundsheet ($sheetname, $offset)
 _store_style ()
 _store_num_format ($format, $ifmt)
 _store_1904 ()
 _store_externcount ($cxals)
 _store_externsheet ($sheetname)
 store_name_short ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 store_name_long ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 _store_palette ()

Detailed Description

Definition at line 47 of file Workbook.php.


Member Function Documentation

Calculate offsets for Worksheet BOF records.

Definition at line 395 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the colour palette to the Excel 97+ default.

Definition at line 244 of file Workbook.php.

Here is the caller graph for this function:

Write Excel 1904 record to indicate the date system in use.

Definition at line 724 of file Workbook.php.

Here is the caller graph for this function:

Store the Excel FONT records.

Definition at line 414 of file Workbook.php.

Here is the caller graph for this function:

Store user defined numerical formats i.e. FORMAT records

Definition at line 456 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write all STYLE records.

Definition at line 533 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Write all XF records.

Definition at line 507 of file Workbook.php.

Here is the caller graph for this function:

_store_boundsheet ( sheetname,
offset 
)

Writes Excel BIFF BOUNDSHEET record.

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

Definition at line 672 of file Workbook.php.

Here is the caller graph for this function:

_store_externcount ( 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

Definition at line 749 of file Workbook.php.

Here is the caller graph for this function:

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

Definition at line 542 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_store_externsheet ( 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

Definition at line 769 of file Workbook.php.

Here is the caller graph for this function:

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

Definition at line 556 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_store_num_format ( format,
ifmt 
)

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

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

Definition at line 709 of file Workbook.php.

Here is the caller graph for this function:

Store the workbook in an OLE container if the total size of the workbook data is less than ~ 7MB.

Definition at line 374 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.

Definition at line 933 of file Workbook.php.

Here is the caller graph for this function:

Write Excel BIFF STYLE records.

Definition at line 688 of file Workbook.php.

Here is the caller graph for this function:

Write Excel BIFF WINDOW1 record.

Definition at line 641 of file Workbook.php.

Here is the caller graph for this function:

& add_format ( properties = array())

Add a new format to the Excel workbook. This adds an XF record and a FONT record. Also, pass any properties to the Format constructor.

public

Parameters:
array$propertiesarray with properties for initializing the format (see Format.php)
Returns:
&object reference to an XF format

Definition at line 182 of file Workbook.php.

Here is the caller graph for this function:

& add_worksheet ( name = '')

Add a new worksheet to the Excel workbook. TODO: Add accessor for $this->{_sheetname} for international Excel versions.

public

Parameters:
string$namethe optional name of the worksheet
Returns:
&object reference to a worksheet object

Definition at line 130 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

& addformat ( properties = array())

DEPRECATED!! Use add_format instead

public

Deprecated:
Use add_format instead
Parameters:
array$propertiesarray with properties for initializing the format (see Format.php)
Returns:
&object reference to an XF format

Definition at line 198 of file Workbook.php.

Here is the call graph for this function:

& addworksheet ( name = '')

DEPRECATED!! Use add_worksheet instead

public

Deprecated:
Use add_worksheet instead
Parameters:
string$namethe optional name of the worksheet
Returns:
&object reference to a worksheet object

Definition at line 169 of file Workbook.php.

Here is the call graph for this function:

close ( )

Calls finalization methods and explicitly close the OLEwriter file handle.

Definition at line 91 of file Workbook.php.

Here is the call graph for this function:

set_custom_color ( 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 214 of file Workbook.php.

sheets ( )

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

Returns:
array

Definition at line 107 of file Workbook.php.

Here is the call graph for this function:

store_name_long ( 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 share a lot of code with _store_name_short() 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

Definition at line 859 of file Workbook.php.

Here is the caller graph for this function:

store_name_short ( 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

Definition at line 794 of file Workbook.php.

Here is the caller graph for this function:

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

Definition at line 329 of file Workbook.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Workbook ( filename)

Class constructor

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

Definition at line 54 of file Workbook.php.

Here is the call graph for this function:

An accessor for the _worksheets[] array.

Returns:
array

Definition at line 117 of file Workbook.php.

Here is the caller graph for this function:


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