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

Public Member Functions

 Spreadsheet_Excel_Writer_Worksheet ($BIFF_version, $name, $index, &$activesheet, &$firstsheet, &$str_total, &$str_unique, &$str_table, &$url_format, &$parser)
 _initialize ()
 close ($sheetnames)
 getName ()
 getData ()
 setMerge ($first_row, $first_col, $last_row, $last_col)
 select ()
 activate ()
 setFirstSheet ()
 protect ($password)
 setColumn ($firstcol, $lastcol, $width, $format=null, $hidden=0, $level=0)
 setSelection ($first_row, $first_column, $last_row, $last_column)
 freezePanes ($panes)
 thawPanes ($panes)
 setPortrait ()
 setLandscape ()
 setPaper ($size=0)
 setHeader ($string, $margin=0.50)
 setFooter ($string, $margin=0.50)
 centerHorizontally ($center=1)
 centerVertically ($center=1)
 setMargins ($margin)
 setMargins_LR ($margin)
 setMargins_TB ($margin)
 setMarginLeft ($margin=0.75)
 setMarginRight ($margin=0.75)
 setMarginTop ($margin=1.00)
 setMarginBottom ($margin=1.00)
 repeatRows ($first_row, $last_row=null)
 repeatColumns ($first_col, $last_col=null)
 printArea ($first_row, $first_col, $last_row, $last_col)
 hideGridlines ()
 hideScreenGridlines ()
 printRowColHeaders ($print=1)
 fitToPages ($width, $height)
 setHPagebreaks ($breaks)
 setVPagebreaks ($breaks)
 setZoom ($scale=100)
 setPrintScale ($scale=100)
 write ($row, $col, $token, $format=null)
 writeRow ($row, $col, $val, $format=null)
 writeCol ($row, $col, $val, $format=null)
 _XF (&$format)
 _append ($data)
 _substituteCellref ($cell)
 _cellToRowcol ($cell)
 _encodePassword ($plaintext)
 setOutline ($visible=true, $symbols_below=true, $symbols_right=true, $auto_style=false)
 writeNumber ($row, $col, $num, $format=null)
 writeString ($row, $col, $str, $format=null)
 setInputEncoding ($encoding)
 writeStringBIFF8 ($row, $col, $str, $format=null)
 _checkRowCol ($row, $col)
 writeNote ($row, $col, $note)
 writeBlank ($row, $col, $format)
 writeFormula ($row, $col, $formula, $format=null)
 writeUrl ($row, $col, $url, $string= '', $format=null)
 _writeUrlRange ($row1, $col1, $row2, $col2, $url, $string= '', $format=null)
 _writeUrlWeb ($row1, $col1, $row2, $col2, $url, $str, $format=null)
 _writeUrlInternal ($row1, $col1, $row2, $col2, $url, $str, $format=null)
 _writeUrlExternal ($row1, $col1, $row2, $col2, $url, $str, $format=null)
 setRow ($row, $height, $format=null, $hidden=false, $level=0)
 _storeDimensions ()
 _storeWindow2 ()
 _storeDefcol ()
 _storeColinfo ($col_array)
 _storeSelection ($array)
 _storeMergedCells ()
 _storeExterncount ($count)
 _storeExternsheet ($sheetname)
 _storePanes ($panes)
 _storeSetup ()
 _storeHeader ()
 _storeFooter ()
 _storeHcenter ()
 _storeVcenter ()
 _storeMarginLeft ()
 _storeMarginRight ()
 _storeMarginTop ()
 _storeMarginBottom ()
 mergeCells ($first_row, $first_col, $last_row, $last_col)
 _storePrintHeaders ()
 _storePrintGridlines ()
 _storeGridset ()
 _storeGuts ()
 _storeWsbool ()
 _storeHbreak ()
 _storeVbreak ()
 _storeProtect ()
 _storePassword ()
 insertBitmap ($row, $col, $bitmap, $x=0, $y=0, $scale_x=1, $scale_y=1)
 _positionImage ($col_start, $row_start, $x1, $y1, $width, $height)
 _sizeCol ($col)
 _sizeRow ($row)
 _storeObjPicture ($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB)
 _processBitmap ($bitmap)
 _storeZoom ()
 setValidation ($row1, $col1, $row2, $col2, &$validator)
 _storeDataValidity ()

Data Fields

 $name
 $index
 $_url_format
 $_parser
 $_filehandle
 $_using_tmpfile
 $_xls_rowmax
 $_xls_colmax
 $_xls_strmax
 $_dim_rowmin
 $_dim_rowmax
 $_dim_colmin
 $_dim_colmax
 $_colinfo
 $_selection
 $_panes
 $_active_pane
 $_frozen
 $selected
 $_paper_size
 $_orientation
 $_header
 $_footer
 $_hcenter
 $_vcenter
 $_margin_head
 $_margin_foot
 $_margin_left
 $_margin_right
 $_margin_top
 $_margin_bottom
 $title_rowmin
 $title_rowmax
 $title_colmin
 $print_rowmin
 $print_rowmax
 $print_colmin
 $print_colmax
 $_outline_on
 $_outline_style
 $_outline_below
 $_outline_right
 $_outline_row_level
 $_fit_page
 $_fit_width
 $_fit_height
 $_str_total
 $_str_unique
 $_str_table
 $_merged_ranges
 $_input_encoding
 $record = 0x01B8
 $length = 0x00000
if(!$format$url = preg_replace('/^external:/', '', $url)
 $url = preg_replace('/\//', "\\", $url)
if($str== '') $str_error = $this->writeString($row1, $col1, $str, $format)
if(($str_error==-2) or($str_error==-3)) $absolute = 0x02
if(!preg_match("/\\\/", $url))
if(preg_match("/^\.\.\\\/",
$url
$link_type ) = 0x01 | $absolute
 $dir_long = $url
if(preg_match("/\#/", $url)) $link_type = pack("V", $link_type)
 $up_count = preg_match_all("/\.\.\\\/", $dir_long, $useless)
 $dir_short = "\0"
 $dir_short_len = pack("V", strlen($dir_short) )
 $dir_long_len = pack("V", strlen($dir_long) )
 $stream_len = pack("V", 0)
 $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' )
 $unknown2 = pack("H*",'0303000000000000C000000000000046' )
 $unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000')
 $unknown4 = pack("v", 0x03 )
 $data
 $header = pack("vv", $record, $length)

Detailed Description

Definition at line 46 of file Worksheet.php.


Member Function Documentation

_append ( data)

Store Worksheet data in memory using the parent's class append() or to a temporary file, the default.

private

Parameters:
string$dataThe binary data to append

Reimplemented from Spreadsheet_Excel_Writer_BIFFwriter.

Definition at line 1255 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_cellToRowcol ( cell)

Convert an Excel cell reference in A1 notation to a zero based row and column reference; converts C1 to (0, 2).

private

Parameters:
string$cellThe cell reference.
Returns:
array containing (row, column)

Definition at line 1315 of file Worksheet.php.

Here is the caller graph for this function:

_checkRowCol ( row,
col 
)

Check row and col before writing to a cell, and update the sheet's dimensions accordingly

private

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
Returns:
boolean true for success, false if row and/or col are grester then maximums allowed.

Definition at line 1591 of file Worksheet.php.

Here is the caller graph for this function:

_encodePassword ( plaintext)

Based on the algorithm provided by Daniel Rentz of OpenOffice.

private

Parameters:
string$plaintextThe password to be encoded in plaintext.
Returns:
string The encoded password

Definition at line 1346 of file Worksheet.php.

Here is the caller graph for this function:

Open a tmp file to store the majority of the Worksheet data. If this fails, for example due to write permissions, store the data in memory. This can be slow for large files.

private

Definition at line 474 of file Worksheet.php.

Here is the caller graph for this function:

_positionImage ( col_start,
row_start,
x1,
y1,
width,
height 
)

Calculate the vertices that define the position of the image as required by the OBJ record.

+------------+------------+ | A | B | +-----+------------+------------+ | |(x1,y1) | | | 1 |(A1)._______|______ | | | | | | | | | | | +-----+----| BITMAP |-----+ | | | | | | 2 | |______________. | | | | (B2)| | | | (x2,y2)| +---- +------------+------------+

Example of a bitmap that covers some of the area from cell A1 to cell B2.

Based on the width and height of the bitmap we need to calculate 8 vars: $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. The width and height of the cells are also variable and have to be taken into account. The values of $col_start and $row_start are passed in from the calling function. The values of $col_end and $row_end are calculated by subtracting the width and height of the bitmap from the width and height of the underlying cells. The vertices are expressed as a percentage of the underlying cell width as follows (rhs values are in pixels):

x1 = X / W *1024 y1 = Y / H *256 x2 = (X-1) / W *1024 y2 = (Y-1) / H *256

Where: X is distance from the left side of the underlying cell Y is distance from the top of the underlying cell W is the width of the cell H is the height of the cell

private

Note:
the SDK incorrectly states that the height should be expressed as a percentage of 1024.
Parameters:
integer$col_startCol containing upper left corner of object
integer$row_startRow containing top left corner of object
integer$x1Distance to left side of object
integer$y1Distance to top of object
integer$widthWidth of image frame
integer$heightHeight of image frame

Definition at line 3173 of file Worksheet.php.

_processBitmap ( bitmap)

Convert a 24 bit bitmap into the modified internal format used by Windows. This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the MSDN library.

private

Parameters:
string$bitmapThe bitmap to process
Returns:
array Array with data and properties of the bitmap

Definition at line 3366 of file Worksheet.php.

_sizeCol ( col)

Convert the width of a cell from user's units to pixels. By interpolation the relationship is: y = 7x +5. If the width hasn't been set by the user we use the default value. If the col is hidden we use a value of zero.

private

Parameters:
integer$colThe column
Returns:
integer The width in pixels

Definition at line 3239 of file Worksheet.php.

_sizeRow ( row)

Convert the height of a cell from user's units to pixels. By interpolation the relationship is: y = 4/3x. If the height hasn't been set by the user we use the default value. If the row is hidden we use a value of zero. (Not possible to hide row yet).

private

Parameters:
integer$rowThe row
Returns:
integer The width in pixels

Definition at line 3263 of file Worksheet.php.

_storeColinfo ( col_array)

Write BIFF record COLINFO to define column widths

Note: The SDK says the record length is 0x0B but Excel writes a 0x0C length record.

private

Parameters:
array$col_arrayThis is the only parameter received and is composed of the following: 0 => First formatted column, 1 => Last formatted column, 2 => Col width (8.43 is Excel default), 3 => The optional XF format of the column, 4 => Option flags. 5 => Optional outline level

Definition at line 2289 of file Worksheet.php.

Here is the caller graph for this function:

Store the DVAL and DV records.

private

Definition at line 3479 of file Worksheet.php.

Write BIFF record DEFCOLWIDTH if COLINFO records are in use.

private

Definition at line 2263 of file Worksheet.php.

Here is the caller graph for this function:

Writes Excel DIMENSIONS to define the area in which there is data.

private

Definition at line 2177 of file Worksheet.php.

Here is the caller graph for this function:

_storeExterncount ( count)

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

Excel only stores references to external sheets that are used in formulas. For simplicity we store references to all the sheets in the workbook regardless of whether they are used or not. This reduces the overall complexity and eliminates the need for a two way dialogue between the formula parser the worksheet objects.

private

Parameters:
integer$countThe number of external sheet references in this worksheet

Definition at line 2413 of file Worksheet.php.

Here is the caller graph for this function:

_storeExternsheet ( sheetname)

Writes the Excel BIFF EXTERNSHEET record. These references are used by formulas. A formula references a sheet name via an index. Since we store a reference to all of the external worksheets the EXTERNSHEET index is the same as the worksheet index.

private

Parameters:
string$sheetnameThe name of a external worksheet

Definition at line 2432 of file Worksheet.php.

Here is the caller graph for this function:

Store the footer caption BIFF record.

private

Definition at line 2630 of file Worksheet.php.

Here is the caller graph for this function:

Write the GRIDSET BIFF record. Must be used in conjunction with the PRINTGRIDLINES record.

private

Definition at line 2846 of file Worksheet.php.

Here is the caller graph for this function:

Write the GUTS BIFF record. This is used to configure the gutter margins where Excel outline symbols are displayed. The visibility of the gutters is controlled by a flag in WSBOOL.

See also:
_storeWsbool() private

Definition at line 2866 of file Worksheet.php.

Here is the caller graph for this function:

Write the HORIZONTALPAGEBREAKS BIFF record.

private

Definition at line 2953 of file Worksheet.php.

Here is the caller graph for this function:

Store the horizontal centering HCENTER BIFF record.

private

Definition at line 2658 of file Worksheet.php.

Here is the caller graph for this function:

Store the header caption BIFF record.

private

Definition at line 2602 of file Worksheet.php.

Here is the caller graph for this function:

Store the BOTTOMMARGIN BIFF record.

private

Definition at line 2756 of file Worksheet.php.

Here is the caller graph for this function:

Store the LEFTMARGIN BIFF record.

private

Definition at line 2693 of file Worksheet.php.

Here is the caller graph for this function:

Store the RIGHTMARGIN BIFF record.

private

Definition at line 2714 of file Worksheet.php.

Here is the caller graph for this function:

Store the TOPMARGIN BIFF record.

private

Definition at line 2735 of file Worksheet.php.

Here is the caller graph for this function:

Store the MERGEDCELLS record for all ranges of merged cells

private

Definition at line 2383 of file Worksheet.php.

Here is the caller graph for this function:

_storeObjPicture ( colL,
dxL,
rwT,
dyT,
colR,
dxR,
rwB,
dyB 
)

Store the OBJ record that precedes an IMDATA record. This could be generalise to support other Excel objects.

private

Parameters:
integer$colLColumn containing upper left corner of object
integer$dxLDistance from left side of cell
integer$rwTRow containing top left corner of object
integer$dyTDistance from top of cell
integer$colRColumn containing lower right corner of object
integer$dxRDistance from right of cell
integer$rwBRow containing bottom right corner of object
integer$dyBDistance from bottom of cell

Definition at line 3291 of file Worksheet.php.

_storePanes ( panes)

Writes the Excel BIFF PANE record. The panes can either be frozen or thawed (unfrozen). Frozen panes are specified in terms of an integer number of rows and columns. Thawed panes are specified in terms of Excel's units for rows and columns.

private

Parameters:
array$panesThis is the only parameter received and is composed of the following: 0 => Vertical split position, 1 => Horizontal split position 2 => Top row visible 3 => Leftmost column visible 4 => Active pane

Definition at line 2469 of file Worksheet.php.

Here is the caller graph for this function:

Write the worksheet PASSWORD record.

private

Definition at line 3064 of file Worksheet.php.

Here is the caller graph for this function:

Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the GRIDSET record.

private

Definition at line 2828 of file Worksheet.php.

Here is the caller graph for this function:

Write the PRINTHEADERS BIFF record.

private

Definition at line 2810 of file Worksheet.php.

Here is the caller graph for this function:

Set the Biff PROTECT record to indicate that the worksheet is protected.

private

Definition at line 3041 of file Worksheet.php.

Here is the caller graph for this function:

_storeSelection ( array)

Write BIFF record SELECTION.

private

Parameters:
array$arrayarray containing ($rwFirst,$colFirst,$rwLast,$colLast)
See also:
setSelection()

Definition at line 2342 of file Worksheet.php.

Here is the caller graph for this function:

Store the page setup SETUP BIFF record.

private

Definition at line 2541 of file Worksheet.php.

Here is the caller graph for this function:

Write the VERTICALPAGEBREAKS BIFF record.

private

Definition at line 2996 of file Worksheet.php.

Here is the caller graph for this function:

Store the vertical centering VCENTER BIFF record.

private

Definition at line 2676 of file Worksheet.php.

Here is the caller graph for this function:

Write BIFF record Window2.

private

Definition at line 2204 of file Worksheet.php.

Here is the caller graph for this function:

Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction with the SETUP record.

private

Definition at line 2911 of file Worksheet.php.

Here is the caller graph for this function:

Store the window zoom factor. This should be a reduced fraction but for simplicity we will store all fractions with a numerator of 100.

private

Definition at line 3450 of file Worksheet.php.

Here is the caller graph for this function:

_substituteCellref ( cell)

Substitute an Excel cell reference in A1 notation for zero based row and column values in an argument list.

Ex: ("A4", "Hello") is converted to (3, 0, "Hello").

private

Parameters:
string$cellThe cell reference. Or range of cells.
Returns:
array

Definition at line 1279 of file Worksheet.php.

Here is the call graph for this function:

_writeUrlExternal ( row1,
col1,
row2,
col2,
url,
str,
format = null 
)

Write links to external directory names such as 'c:.xls', c:.xls::Sheet1!A1', '../../foo.xls'. and '../../foo.xls::Sheet1!A1'.

Note: Excel writes some relative links with the $dir_long string. We ignore these cases for the sake of simpler code.

private

See also:
writeUrl()
Parameters:
integer$row1Start row
integer$col1Start column
integer$row2End row
integer$col2End column
string$urlURL string
string$strAlternative label
mixed$formatThe cell format
Returns:
integer

Definition at line 1994 of file Worksheet.php.

Here is the caller graph for this function:

_writeUrlInternal ( row1,
col1,
row2,
col2,
url,
str,
format = null 
)

Used to write internal reference hyperlinks such as "Sheet1!A1".

private

See also:
writeUrl()
Parameters:
integer$row1Start row
integer$col1Start column
integer$row2End row
integer$col2End column
string$urlURL string
string$strAlternative label
mixed$formatThe cell format
Returns:
integer

Definition at line 1928 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_writeUrlRange ( row1,
col1,
row2,
col2,
url,
string = '',
format = null 
)

This is the more general form of writeUrl(). It allows a hyperlink to be written to a range of cells. This function also decides the type of hyperlink to be written. These are either, Web (http, ftp, mailto), Internal (Sheet1!A1) or external ('c:.xls::Sheet1!A1').

private

See also:
writeUrl()
Parameters:
integer$row1Start row
integer$col1Start column
integer$row2End row
integer$col2End column
string$urlURL string
string$stringAlternative label
mixed$formatThe cell format
Returns:
integer

Definition at line 1838 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_writeUrlWeb ( row1,
col1,
row2,
col2,
url,
str,
format = null 
)

Used to write http, ftp and mailto hyperlinks. The link type ($options) is 0x03 is the same as absolute dir ref without sheet. However it is differentiated by the $unknown2 data stream.

private

See also:
writeUrl()
Parameters:
integer$row1Start row
integer$col1Start column
integer$row2End row
integer$col2End column
string$urlURL string
string$strAlternative label
mixed$formatThe cell format
Returns:
integer

Definition at line 1868 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_XF ( &$  format)

Returns an index to the XF record in the workbook

private

Parameters:
mixed&$formatThe optional XF format
Returns:
integer The XF record index

Definition at line 1231 of file Worksheet.php.

Here is the caller graph for this function:

activate ( )

Set this worksheet as the active worksheet, i.e. the worksheet that is displayed when the workbook is opened. Also set it as selected.

public

Definition at line 688 of file Worksheet.php.

centerHorizontally ( center = 1)

Center the page horinzontally.

public

Parameters:
integer$centerthe optional value for centering. Defaults to 1 (center).

Definition at line 863 of file Worksheet.php.

centerVertically ( center = 1)

Center the page vertically.

public

Parameters:
integer$centerthe optional value for centering. Defaults to 1 (center).

Definition at line 874 of file Worksheet.php.

close ( sheetnames)

Add data to the beginning of the workbook (note the reverse order) and to the end of the workbook.

public

See also:
Spreadsheet_Excel_Writer_Workbook::storeWorkbook()
Parameters:
array$sheetnamesThe array of sheetnames from the Workbook this worksheet belongs to

Definition at line 496 of file Worksheet.php.

Here is the call graph for this function:

fitToPages ( width,
height 
)

Set the vertical and horizontal number of pages that will define the maximum area printed. It doesn't seem to work with OpenOffice.

public

Parameters:
integer$widthMaximun width of printed area in pages
integer$heightMaximun heigth of printed area in pages
See also:
setPrintScale()

Definition at line 1053 of file Worksheet.php.

freezePanes ( panes)

Set panes and mark them as frozen.

public

Parameters:
array$panesThis is the only parameter received and is composed of the following: 0 => Vertical split position, 1 => Horizontal split position 2 => Top row visible 3 => Leftmost column visible 4 => Active pane

Definition at line 768 of file Worksheet.php.

getData ( )

Retrieves data from memory in one chunk, or from disk in $buffer sized chunks.

Returns:
string The data

Definition at line 626 of file Worksheet.php.

getName ( )

Retrieve the worksheet name. This is usefull when creating worksheets without a name.

public

Returns:
string The worksheet's name

Definition at line 615 of file Worksheet.php.

Set the option to hide gridlines on the printed page.

public

Definition at line 1018 of file Worksheet.php.

Set the option to hide gridlines on the worksheet (as seen on the screen).

public

Definition at line 1028 of file Worksheet.php.

insertBitmap ( row,
col,
bitmap,
x = 0,
y = 0,
scale_x = 1,
scale_y = 1 
)

Insert a 24bit bitmap image in a worksheet.

public

Parameters:
integer$rowThe row we are going to insert the bitmap into
integer$colThe column we are going to insert the bitmap into
string$bitmapThe bitmap filename
integer$xThe horizontal position (offset) of the image inside the cell.
integer$yThe vertical position (offset) of the image inside the cell.
integer$scale_xThe horizontal scale
integer$scale_yThe vertical scale

Definition at line 3095 of file Worksheet.php.

mergeCells ( first_row,
first_col,
last_row,
last_col 
)

Merges the area given by its arguments. This is an Excel97/2000 method. It is required to perform more complicated merging than the normal setAlign('merge').

public

Parameters:
integer$first_rowFirst row of the area to merge
integer$first_colFirst column of the area to merge
integer$last_rowLast row of the area to merge
integer$last_colLast column of the area to merge

Definition at line 2783 of file Worksheet.php.

printArea ( first_row,
first_col,
last_row,
last_col 
)

Set the area of each worksheet that will be printed.

public

Parameters:
integer$first_rowFirst row of the area to print
integer$first_colFirst column of the area to print
integer$last_rowLast row of the area to print
integer$last_colLast column of the area to print

Definition at line 1004 of file Worksheet.php.

printRowColHeaders ( print = 1)

Set the option to print the row and column headers on the printed page.

public

Parameters:
integer$printWhether to print the headers or not. Defaults to 1 (print).

Definition at line 1039 of file Worksheet.php.

protect ( password)

Set the worksheet protection flag to prevent accidental modification and to hide formulas if the locked and hidden format properties have been set.

public

Parameters:
string$passwordThe password to use for protecting the sheet.

Definition at line 714 of file Worksheet.php.

Here is the call graph for this function:

repeatColumns ( first_col,
last_col = null 
)

Set the columns to repeat at the left hand side of each printed page.

public

Parameters:
integer$first_colFirst column to repeat
integer$last_colLast column to repeat. Optional.

Definition at line 985 of file Worksheet.php.

repeatRows ( first_row,
last_row = null 
)

Set the rows to repeat at the top of each printed page.

public

Parameters:
integer$first_rowFirst row to repeat
integer$last_rowLast row to repeat. Optional.

Definition at line 968 of file Worksheet.php.

select ( )

Set this worksheet as a selected worksheet, i.e. the worksheet has its tab highlighted.

public

Definition at line 676 of file Worksheet.php.

setColumn ( firstcol,
lastcol,
width,
format = null,
hidden = 0,
level = 0 
)

Set the width of a single column or a range of columns.

public

Parameters:
integer$firstcolfirst column on the range
integer$lastcollast column on the range
integer$widthwidth to set
mixed$formatThe optional XF format to apply to the columns
integer$hiddenThe optional hidden atribute
integer$levelThe optional outline level

Definition at line 731 of file Worksheet.php.

Set this worksheet as the first visible sheet. This is necessary when there are a large number of worksheets and the activated worksheet is not visible on the screen.

public

Definition at line 701 of file Worksheet.php.

setFooter ( string,
margin = 0.50 
)

Set the page footer caption and optional margin.

public

Parameters:
string$stringThe footer text
float$marginoptional foot margin in inches.

Definition at line 847 of file Worksheet.php.

setHeader ( string,
margin = 0.50 
)

Set the page header caption and optional margin.

public

Parameters:
string$stringThe header text
float$marginoptional head margin in inches.

Definition at line 830 of file Worksheet.php.

setHPagebreaks ( breaks)

Store the horizontal page breaks on a worksheet (for printing). The breaks represent the row after which the break is inserted.

public

Parameters:
array$breaksArray containing the horizontal page breaks

Definition at line 1067 of file Worksheet.php.

setInputEncoding ( encoding)

Sets Input Encoding for writing strings

public

Parameters:
string$encodingThe encoding. Ex: 'UTF-16LE', 'utf-8', 'ISO-859-7'

Definition at line 1515 of file Worksheet.php.

Here is the call graph for this function:

Set the page orientation as landscape.

public

Definition at line 806 of file Worksheet.php.

setMarginBottom ( margin = 1.00)

Set the bottom margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 956 of file Worksheet.php.

Here is the caller graph for this function:

setMarginLeft ( margin = 0.75)

Set the left margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 923 of file Worksheet.php.

Here is the caller graph for this function:

setMarginRight ( margin = 0.75)

Set the right margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 934 of file Worksheet.php.

Here is the caller graph for this function:

setMargins ( margin)

Set all the page margins to the same value in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 885 of file Worksheet.php.

Here is the call graph for this function:

setMargins_LR ( margin)

Set the left and right margins to the same value in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 899 of file Worksheet.php.

Here is the call graph for this function:

setMargins_TB ( margin)

Set the top and bottom margins to the same value in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 911 of file Worksheet.php.

Here is the call graph for this function:

setMarginTop ( margin = 1.00)

Set the top margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 945 of file Worksheet.php.

Here is the caller graph for this function:

setMerge ( first_row,
first_col,
last_row,
last_col 
)

Sets a merged cell range

public

Parameters:
integer$first_rowFirst row of the area to merge
integer$first_colFirst column of the area to merge
integer$last_rowLast row of the area to merge
integer$last_colLast column of the area to merge

Definition at line 660 of file Worksheet.php.

setOutline ( visible = true,
symbols_below = true,
symbols_right = true,
auto_style = false 
)

This method sets the properties for outlining and grouping. The defaults correspond to Excel's defaults.

Parameters:
bool$visible
bool$symbols_below
bool$symbols_right
bool$auto_style

Definition at line 1376 of file Worksheet.php.

setPaper ( size = 0)

Set the paper type. Ex. 1 = US Letter, 9 = A4

public

Parameters:
integer$sizeThe type of paper size to use

Definition at line 817 of file Worksheet.php.

Set the page orientation as portrait.

public

Definition at line 796 of file Worksheet.php.

setPrintScale ( scale = 100)

Set the scale factor for the printed page. It turns off the "fit to page" option

public

Parameters:
integer$scaleThe optional scale factor. Defaults to 100

Definition at line 1113 of file Worksheet.php.

Here is the call graph for this function:

setRow ( row,
height,
format = null,
hidden = false,
level = 0 
)

This method is used to set the height and format for a row.

public

Parameters:
integer$rowThe row to set
integer$heightHeight we are giving to the row. Use null to set XF without setting height
mixed$formatXF format we are giving to the row
bool$hiddenThe optional hidden attribute
integer$levelThe optional outline level for row, in range [0,7]

Definition at line 2124 of file Worksheet.php.

setSelection ( first_row,
first_column,
last_row,
last_column 
)

Set which cell or cells are selected in a worksheet

public

Parameters:
integer$first_rowfirst row in the selected quadrant
integer$first_columnfirst column in the selected quadrant
integer$last_rowlast row in the selected quadrant
integer$last_columnlast column in the selected quadrant

Definition at line 752 of file Worksheet.php.

setValidation ( row1,
col1,
row2,
col2,
&$  validator 
)

FIXME: add comments

Definition at line 3468 of file Worksheet.php.

setVPagebreaks ( breaks)

Store the vertical page breaks on a worksheet (for printing). The breaks represent the column after which the break is inserted.

public

Parameters:
array$breaksArray containing the vertical page breaks

Definition at line 1081 of file Worksheet.php.

setZoom ( scale = 100)

Set the worksheet zoom factor.

public

Parameters:
integer$scaleThe zoom factor

Definition at line 1095 of file Worksheet.php.

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Worksheet ( BIFF_version,
name,
index,
&$  activesheet,
&$  firstsheet,
&$  str_total,
&$  str_unique,
&$  str_table,
&$  url_format,
&$  parser 
)

Constructor

Parameters:
string$nameThe name of the new worksheet
integer$indexThe index of the new worksheet
mixed&$activesheetThe current activesheet of the workbook we belong to
mixed&$firstsheetThe first worksheet in the workbook we belong to
mixed&$url_formatThe default format for hyperlinks
mixed&$parserThe formula parser created for the Workbook private

Definition at line 369 of file Worksheet.php.

Here is the call graph for this function:

thawPanes ( panes)

Set panes and mark them as unfrozen.

public

Parameters:
array$panesThis is the only parameter received and is composed of the following: 0 => Vertical split position, 1 => Horizontal split position 2 => Top row visible 3 => Leftmost column visible 4 => Active pane

Definition at line 785 of file Worksheet.php.

write ( row,
col,
token,
format = null 
)

Map to the appropriate write method acording to the token recieved.

public

Parameters:
integer$rowThe row of the cell we are writing to
integer$colThe column of the cell we are writing to
mixed$tokenWhat we are writing
mixed$formatThe optional format to apply to the cell

Definition at line 1136 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeBlank ( row,
col,
format 
)

Write a blank cell to the specified row and column (zero indexed). A blank cell is used to specify formatting without adding a string or a number.

A blank cell without a format serves no purpose. Therefore, we don't write a BLANK record unless a format is specified.

Returns 0 : normal termination (including no format) -1 : insufficient number of arguments -2 : row or column out of range

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
mixed$formatThe XF format

Definition at line 1683 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeCol ( row,
col,
val,
format = null 
)

Write an array of values as a column

public

Parameters:
integer$rowThe first row (uppermost row) we are writing to
integer$colThe col we are writing to
array$valThe array of values to write
mixed$formatThe optional format to apply to the cell
Returns:
mixed PEAR_Error on failure

Definition at line 1210 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeFormula ( row,
col,
formula,
format = null 
)

Write a formula to the specified row and column (zero indexed). The textual representation of the formula is passed to the parser in Parser.php which returns a packed binary string.

Returns 0 : normal termination -1 : formula errors (bad formula) -2 : row or column out of range

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
string$formulaThe formula text string
mixed$formatThe optional XF format
Returns:
integer

Definition at line 1736 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeNote ( row,
col,
note 
)

Writes a note associated with the cell given by the row and column. NOTE records don't have a length limit.

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
string$noteThe note to write

Definition at line 1623 of file Worksheet.php.

Here is the call graph for this function:

writeNumber ( row,
col,
num,
format = null 
)

Write a double to the specified row and column (zero indexed). An integer can be written as a double. Excel will display an integer. $format is optional.

Returns 0 : normal termination -2 : row or column out of range

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
float$numThe number to write
mixed$formatThe optional XF format
Returns:
integer

Definition at line 1411 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeRow ( row,
col,
val,
format = null 
)

Write an array of values as a row

public

Parameters:
integer$rowThe row we are writing to
integer$colThe first col (leftmost col) we are writing to
array$valThe array of values to write
mixed$formatThe optional format to apply to the cell
Returns:
mixed PEAR_Error on failure

Definition at line 1181 of file Worksheet.php.

Here is the call graph for this function:

writeString ( row,
col,
str,
format = null 
)

Write a string to the specified row and column (zero indexed). NOTE: there is an Excel 5 defined limit of 255 characters. $format is optional. Returns 0 : normal termination -2 : row or column out of range -3 : long string truncated to 255 chars

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
string$strThe string to write
mixed$formatThe XF format for the cell
Returns:
integer

Definition at line 1464 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeStringBIFF8 ( row,
col,
str,
format = null 
)

Write a string to the specified row and column (zero indexed). This is the BIFF8 version (no 255 chars limit). $format is optional. Returns 0 : normal termination -2 : row or column out of range -3 : long string truncated to 255 chars

public

Parameters:
integer$rowZero indexed row
integer$colZero indexed column
string$strThe string to write
mixed$formatThe XF format for the cell
Returns:
integer

Definition at line 1538 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writeUrl ( row,
col,
url,
string = '',
format = null 
)

Write a hyperlink. This is comprised of two elements: the visible label and the invisible link. The visible label is the same as the link unless an alternative string is specified. The label is written using the writeString() method. Therefore the 255 characters string limit applies. $string and $format are optional.

The hyperlink can be to a http, ftp, mail, internal sheet (not yet), or external directory url.

Returns 0 : normal termination -2 : row or column out of range -3 : long string truncated to 255 chars

public

Parameters:
integer$rowRow
integer$colColumn
string$urlURL string
string$stringAlternative label
mixed$formatThe cell format
Returns:
integer

Definition at line 1814 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$_active_pane

Definition at line 152 of file Worksheet.php.

$_colinfo

Definition at line 134 of file Worksheet.php.

$_dim_colmax

Definition at line 128 of file Worksheet.php.

$_dim_colmin

Definition at line 121 of file Worksheet.php.

$_dim_rowmax

Definition at line 114 of file Worksheet.php.

$_dim_rowmin

Definition at line 107 of file Worksheet.php.

$_filehandle

Definition at line 76 of file Worksheet.php.

$_fit_height

Definition at line 326 of file Worksheet.php.

$_fit_page

Definition at line 314 of file Worksheet.php.

$_fit_width

Definition at line 320 of file Worksheet.php.

$_footer

Definition at line 188 of file Worksheet.php.

$_frozen

Definition at line 158 of file Worksheet.php.

$_hcenter

Definition at line 194 of file Worksheet.php.

$_header

Definition at line 182 of file Worksheet.php.

$_input_encoding

Definition at line 356 of file Worksheet.php.

$_margin_bottom

Definition at line 236 of file Worksheet.php.

$_margin_foot

Definition at line 212 of file Worksheet.php.

$_margin_head

Definition at line 206 of file Worksheet.php.

$_margin_left

Definition at line 218 of file Worksheet.php.

$_margin_right

Definition at line 224 of file Worksheet.php.

$_margin_top

Definition at line 230 of file Worksheet.php.

$_merged_ranges

Definition at line 350 of file Worksheet.php.

$_orientation

Definition at line 176 of file Worksheet.php.

$_outline_below

Definition at line 296 of file Worksheet.php.

$_outline_on

Definition at line 284 of file Worksheet.php.

$_outline_right

Definition at line 302 of file Worksheet.php.

$_outline_row_level

Definition at line 308 of file Worksheet.php.

$_outline_style

Definition at line 290 of file Worksheet.php.

$_panes

Definition at line 146 of file Worksheet.php.

$_paper_size

Definition at line 170 of file Worksheet.php.

$_parser

Definition at line 70 of file Worksheet.php.

$_selection

Definition at line 140 of file Worksheet.php.

$_str_table

Definition at line 344 of file Worksheet.php.

$_str_total

Definition at line 332 of file Worksheet.php.

$_str_unique

Definition at line 338 of file Worksheet.php.

$_url_format

Definition at line 64 of file Worksheet.php.

$_using_tmpfile

Definition at line 82 of file Worksheet.php.

$_vcenter

Definition at line 200 of file Worksheet.php.

$_xls_colmax

Definition at line 94 of file Worksheet.php.

$_xls_rowmax

Definition at line 88 of file Worksheet.php.

$_xls_strmax

Definition at line 100 of file Worksheet.php.

if (($str_error==-2) or($str_error==-3)) $absolute = 0x02

Definition at line 2028 of file Worksheet.php.

$data
Initial value:
 pack("vvvv", $row1, $row2, $col1, $col2) .
                          $unknown1     .
                          $link_type    .
                          $unknown2     .
                          $up_count     .
                          $dir_short_len.
                          $dir_short    .
                          $unknown3     .
                          $stream_len

Definition at line 2088 of file Worksheet.php.

$dir_long = $url

Definition at line 2055 of file Worksheet.php.

$dir_long_len = pack("V", strlen($dir_long) )

Definition at line 2078 of file Worksheet.php.

$dir_short = "\0"

Definition at line 2070 of file Worksheet.php.

$dir_short_len = pack("V", strlen($dir_short) )

Definition at line 2077 of file Worksheet.php.

$header = pack("vv", $record, $length)

Definition at line 2105 of file Worksheet.php.

$index

Definition at line 58 of file Worksheet.php.

$length = 0x00000

Definition at line 2003 of file Worksheet.php.

if (!preg_match("/\\\/", $url)) if (preg_match("/^\.\.\\\/", $url) $link_type) = 0x01 | $absolute

Definition at line 2035 of file Worksheet.php.

if (preg_match("/\#/", $url)) $link_type = pack("V", $link_type)

Definition at line 2063 of file Worksheet.php.

$name

Definition at line 52 of file Worksheet.php.

$print_colmax

Definition at line 278 of file Worksheet.php.

$print_colmin

Definition at line 272 of file Worksheet.php.

$print_rowmax

Definition at line 266 of file Worksheet.php.

$print_rowmin

Definition at line 260 of file Worksheet.php.

$record = 0x01B8

Definition at line 2002 of file Worksheet.php.

$selected

Definition at line 164 of file Worksheet.php.

if ($str== '') $str_error = $this->writeString($row1, $col1, $str, $format)

Definition at line 2018 of file Worksheet.php.

$stream_len = pack("V", 0)

Definition at line 2079 of file Worksheet.php.

$title_colmin

Definition at line 254 of file Worksheet.php.

$title_rowmax

Definition at line 248 of file Worksheet.php.

$title_rowmin

Definition at line 242 of file Worksheet.php.

$unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' )

Definition at line 2082 of file Worksheet.php.

$unknown2 = pack("H*",'0303000000000000C000000000000046' )

Definition at line 2083 of file Worksheet.php.

$unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000')

Definition at line 2084 of file Worksheet.php.

$unknown4 = pack("v", 0x03 )

Definition at line 2085 of file Worksheet.php.

$up_count = preg_match_all("/\.\.\\\/", $dir_long, $useless)

Definition at line 2066 of file Worksheet.php.

if (!$format) $url = preg_replace('/^external:/', '', $url)

Definition at line 2011 of file Worksheet.php.

$url = preg_replace('/\//', "\\", $url)

Definition at line 2012 of file Worksheet.php.


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