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

Public Member Functions

 Worksheet ($name, $index, &$activesheet, &$firstsheet, &$url_format, &$parser)
 _initialize ()
 close ($sheetnames)
 get_name ()
 get_data ()
 select ()
 activate ()
 set_first_sheet ()
 protect ($password)
 set_column ($firstcol, $lastcol, $width, $format=0, $hidden=0)
 set_selection ($first_row, $first_column, $last_row, $last_column)
 freeze_panes ($panes)
 thaw_panes ($panes)
 set_portrait ()
 set_landscape ()
 set_paper ($size=0)
 set_header ($string, $margin=0.50)
 set_footer ($string, $margin=0.50)
 center_horizontally ($center=1)
 center_vertically ($center=1)
 set_margins ($margin)
 set_margins_LR ($margin)
 set_margins_TB ($margin)
 set_margin_left ($margin=0.75)
 set_margin_right ($margin=0.75)
 set_margin_top ($margin=1.00)
 set_margin_bottom ($margin=1.00)
 repeat_rows ($first_row, $last_row=NULL)
 repeat_columns ($first_col, $last_col=NULL)
 print_area ($first_row, $first_col, $last_row, $last_col)
 hide_gridlines ()
 print_row_col_headers ($print=1)
 fit_to_pages ($width, $height)
 set_h_pagebreaks ($breaks)
 set_v_pagebreaks ($breaks)
 set_zoom ($scale=100)
 set_print_scale ($scale=100)
 write ($row, $col, $token, $format=0)
 _XF (&$format)
 _append ($data)
 _substitute_cellref ($cell)
 _cell_to_rowcol ($cell)
 _encode_password ($plaintext)
 write_number ($row, $col, $num, $format=0)
 write_string ($row, $col, $str, $format=0)
 write_note ($row, $col, $note)
 write_blank ($row, $col, $format=0)
 write_formula ($row, $col, $formula, $format=0)
 write_url ($row, $col, $url, $string= '', $format=0)
 _write_url_range ($row1, $col1, $row2, $col2, $url, $string= '', $format=0)
 _write_url_web ($row1, $col1, $row2, $col2, $url, $str, $format=0)
 _write_url_internal ($row1, $col1, $row2, $col2, $url, $str, $format=0)
 _write_url_external ($row1, $col1, $row2, $col2, $url, $str, $format=0)
 set_row ($row, $height, $format=0)
 _store_dimensions ()
 _store_window2 ()
 _store_defcol ()
 _store_colinfo ($col_array)
 _store_selection ($array)
 _store_externcount ($count)
 _store_externsheet ($sheetname)
 _store_panes ($panes)
 _store_setup ()
 store_header ()
 store_footer ()
 store_hcenter ()
 store_vcenter ()
 _store_margin_left ()
 _store_margin_right ()
 _store_margin_top ()
 _store_margin_bottom ()
 merge_cells ($first_row, $first_col, $last_row, $last_col)
 _store_print_headers ()
 _store_print_gridlines ()
 _store_gridset ()
 _store_wsbool ()
 _store_hbreak ()
 _store_vbreak ()
 _store_protect ()
 _store_password ()
 insert_bitmap ($row, $col, $bitmap, $x=0, $y=0, $scale_x=1, $scale_y=1)
 _position_image ($col_start, $row_start, $x1, $y1, $width, $height)
 size_col ($col)
 size_row ($row)
 _store_obj_picture ($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB)
 _process_bitmap ($bitmap)
 _store_zoom ()

Data Fields

 $record = 0x01B8
 $length = 0x00000
if($format==0) $url = preg_replace('[^external:]', '', $url)
 $url = preg_replace('[/]', "\\", $url)
if($str== '') $str_error = $this->write_string($row1, $col1, $str, $format)
if($str_error==-2) $absolute = 0x02
 $link_type = 0x01 | $absolute
 $up_count = preg_match_all("/\.\.\\/", $dir_long, $useless)
 $dir_short = "\0"
 $dir_long = join("\0", str_split($dir_long))
 $dir_short_len = pack("V", strlen($dir_short) )
 $dir_long_len = pack("V", strlen($dir_long) )
 $stream_len = pack("V", strlen($dir_long) + 0x06)
 $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 45 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.

Parameters:
string$dataThe binary data to append

Definition at line 846 of file Worksheet.php.

Here is the caller graph for this function:

_cell_to_rowcol ( cell)

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

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

Definition at line 905 of file Worksheet.php.

Here is the caller graph for this function:

_encode_password ( plaintext)

Based on the algorithm provided by Daniel Rentz of OpenOffice.

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

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

Definition at line 140 of file Worksheet.php.

Here is the caller graph for this function:

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

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 2546 of file Worksheet.php.

_process_bitmap ( 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.

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

Definition at line 2738 of file Worksheet.php.

_store_colinfo ( 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.

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.

Definition at line 1822 of file Worksheet.php.

Here is the caller graph for this function:

Write BIFF record DEFCOLWIDTH if COLINFO records are in use.

Definition at line 1798 of file Worksheet.php.

Here is the caller graph for this function:

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

Definition at line 1736 of file Worksheet.php.

Here is the caller graph for this function:

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

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

Definition at line 1920 of file Worksheet.php.

Here is the caller graph for this function:

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

Parameters:
string$sheetnameThe name of a external worksheet

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

Definition at line 2314 of file Worksheet.php.

Here is the caller graph for this function:

Write the HORIZONTALPAGEBREAKS BIFF record.

Definition at line 2354 of file Worksheet.php.

Here is the caller graph for this function:

Store the BOTTOMMARGIN BIFF record.

Definition at line 2229 of file Worksheet.php.

Here is the caller graph for this function:

Store the LEFTMARGIN BIFF record.

Definition at line 2169 of file Worksheet.php.

Here is the caller graph for this function:

Store the RIGHTMARGIN BIFF record.

Definition at line 2189 of file Worksheet.php.

Here is the caller graph for this function:

Store the TOPMARGIN BIFF record.

Definition at line 2209 of file Worksheet.php.

Here is the caller graph for this function:

_store_obj_picture ( 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.

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 2664 of file Worksheet.php.

_store_panes ( 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.

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 1975 of file Worksheet.php.

Here is the caller graph for this function:

Write the worksheet PASSWORD record.

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

Definition at line 2298 of file Worksheet.php.

Here is the caller graph for this function:

Write the PRINTHEADERS BIFF record.

Definition at line 2282 of file Worksheet.php.

Here is the caller graph for this function:

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

Definition at line 2422 of file Worksheet.php.

Here is the caller graph for this function:

_store_selection ( array)

Write BIFF record SELECTION.

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

Definition at line 1869 of file Worksheet.php.

Here is the caller graph for this function:

Store the page setup SETUP BIFF record.

Definition at line 2044 of file Worksheet.php.

Here is the caller graph for this function:

Write the VERTICALPAGEBREAKS BIFF record.

Definition at line 2387 of file Worksheet.php.

Here is the caller graph for this function:

Write BIFF record Window2.

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

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

Definition at line 2820 of file Worksheet.php.

Here is the caller graph for this function:

_substitute_cellref ( 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").

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

Definition at line 871 of file Worksheet.php.

Here is the call graph for this function:

_write_url_external ( row1,
col1,
row2,
col2,
url,
str,
format = 0 
)

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.

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

Definition at line 1488 of file Worksheet.php.

Here is the caller graph for this function:

_write_url_internal ( row1,
col1,
row2,
col2,
url,
str,
format = 0 
)

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

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

Definition at line 1424 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_write_url_range ( row1,
col1,
row2,
col2,
url,
string = '',
format = 0 
)

This is the more general form of write_url(). 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').

See also write_url() above for a general description and return values.

Parameters:
integer$row1Start row
integer$col1Start column
integer$row2End row
integer$col2End column
string$urlURL string
string$stringAlternative label
mixed$formatThe cell format

Definition at line 1339 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_write_url_web ( row1,
col1,
row2,
col2,
url,
str,
format = 0 
)

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.

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

Definition at line 1366 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

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

Definition at line 820 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 319 of file Worksheet.php.

center_horizontally ( center = 1)

Center the page horinzontally.

public

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

Definition at line 494 of file Worksheet.php.

center_vertically ( center = 1)

Center the page horinzontally.

public

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

Definition at line 505 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:
Workbook::store_workbook()
Parameters:
array$sheetnamesThe array of sheetnames from the Workbook this worksheet belongs to

Definition at line 163 of file Worksheet.php.

Here is the call graph for this function:

fit_to_pages ( width,
height 
)

Store 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$heigthMaximun heigth of printed area in pages
See also:
set_print_scale()

Definition at line 682 of file Worksheet.php.

freeze_panes ( 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 399 of file Worksheet.php.

get_data ( )

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

Returns:
string The data

Definition at line 277 of file Worksheet.php.

get_name ( )

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

public

Returns:
string The worksheet's name

Definition at line 266 of file Worksheet.php.

Set the option to hide gridlines on the printed page.

public

See also:
_store_print_gridlines(), _store_gridset()

Definition at line 655 of file Worksheet.php.

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

Insert a 24bit bitmap image in a worksheet. The main record required is IMDATA but it must be proceeded by a OBJ record to define its position.

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 2474 of file Worksheet.php.

merge_cells ( first_row,
first_col,
last_row,
last_col 
)

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

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 2257 of file Worksheet.php.

print_area ( first_row,
first_col,
last_row,
last_col 
)

Set the area of each worksheet that will be printed.

public

See also:
Workbook::_store_names()
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 640 of file Worksheet.php.

print_row_col_headers ( print = 1)

Set the option to print the row and column headers on the printed page. See also the _store_print_headers() method below.

public

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

Definition at line 668 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 344 of file Worksheet.php.

Here is the call graph for this function:

repeat_columns ( first_col,
last_col = NULL 
)

Set the columns to repeat at the left hand side of each printed page. See also the _store_names() methods in Workbook.php

public

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

Definition at line 619 of file Worksheet.php.

repeat_rows ( first_row,
last_row = NULL 
)

Set the rows to repeat at the top of each printed page. See also the _store_name_xxxx() methods in Workbook.php

public

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

Definition at line 600 of file Worksheet.php.

select ( )

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

public

Definition at line 308 of file Worksheet.php.

set_column ( firstcol,
lastcol,
width,
format = 0,
hidden = 0 
)

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

public

See also:
_store_colinfo()
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

Definition at line 361 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 332 of file Worksheet.php.

set_footer ( 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 478 of file Worksheet.php.

set_h_pagebreaks ( 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 696 of file Worksheet.php.

set_header ( 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 461 of file Worksheet.php.

Set the page orientation as landscape.

public

Definition at line 437 of file Worksheet.php.

set_margin_bottom ( margin = 1.00)

Set the bottom margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 587 of file Worksheet.php.

Here is the caller graph for this function:

set_margin_left ( margin = 0.75)

Set the left margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 554 of file Worksheet.php.

Here is the caller graph for this function:

set_margin_right ( margin = 0.75)

Set the right margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 565 of file Worksheet.php.

Here is the caller graph for this function:

set_margin_top ( margin = 1.00)

Set the top margin in inches.

public

Parameters:
float$marginThe margin to set in inches

Definition at line 576 of file Worksheet.php.

Here is the caller graph for this function:

set_margins ( margin)

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

public

Parameters:
float$marginThe margin to set in inches

Definition at line 516 of file Worksheet.php.

Here is the call graph for this function:

set_margins_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 530 of file Worksheet.php.

Here is the call graph for this function:

set_margins_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 542 of file Worksheet.php.

Here is the call graph for this function:

set_paper ( 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 448 of file Worksheet.php.

Set the page orientation as portrait.

public

Definition at line 427 of file Worksheet.php.

set_print_scale ( 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 742 of file Worksheet.php.

set_row ( row,
height,
format = 0 
)

This method is used to set the height and XF format for a row. Writes the BIFF record 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

Definition at line 1707 of file Worksheet.php.

set_selection ( 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
See also:
_store_selection()

Definition at line 383 of file Worksheet.php.

set_v_pagebreaks ( 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 710 of file Worksheet.php.

set_zoom ( scale = 100)

Set the worksheet zoom factor.

public

Parameters:
integer$scaleThe zoom factor

Definition at line 724 of file Worksheet.php.

size_col ( 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.

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

Definition at line 2610 of file Worksheet.php.

size_row ( 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).

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

Definition at line 2635 of file Worksheet.php.

Store the footer caption BIFF record.

Definition at line 2121 of file Worksheet.php.

Here is the caller graph for this function:

Store the horizontal centering HCENTER BIFF record.

Definition at line 2138 of file Worksheet.php.

Here is the caller graph for this function:

Store the header caption BIFF record.

Definition at line 2104 of file Worksheet.php.

Here is the caller graph for this function:

Store the vertical centering VCENTER BIFF record.

Definition at line 2154 of file Worksheet.php.

Here is the caller graph for this function:

thaw_panes ( 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 416 of file Worksheet.php.

Worksheet ( name,
index,
&$  activesheet,
&$  firstsheet,
&$  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

Definition at line 58 of file Worksheet.php.

Here is the call graph for this function:

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

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 767 of file Worksheet.php.

Here is the call graph for this function:

write_blank ( row,
col,
format = 0 
)

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. This is mainly an optimisation for the write_row() and write_col() methods.

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 1167 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_formula ( row,
col,
formula,
format = 0 
)

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

Definition at line 1225 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_note ( 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 1099 of file Worksheet.php.

Here is the call graph for this function:

write_number ( row,
col,
num,
format = 0 
)

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

Definition at line 982 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_string ( row,
col,
str,
format = 0 
)

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 -1 : insufficient number of arguments -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

Definition at line 1041 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_url ( row,
col,
url,
string = '',
format = 0 
)

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 write_string() method. Therefore the 255 characters string limit applies. $string and $format are optional and their order is interchangeable.

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

Returns 0 : normal termination -1 : insufficient number of arguments -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

Definition at line 1316 of file Worksheet.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

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

Definition at line 1522 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   .
                          $dir_long_len .
                          $unknown4     .
                          $dir_long     .
                          $sheet_len    .
                          $sheet

Definition at line 1573 of file Worksheet.php.

$dir_long = join("\0", str_split($dir_long))

Definition at line 1558 of file Worksheet.php.

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

Definition at line 1563 of file Worksheet.php.

$dir_short = "\0"

Definition at line 1555 of file Worksheet.php.

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

Definition at line 1562 of file Worksheet.php.

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

Definition at line 1590 of file Worksheet.php.

$length = 0x00000

Definition at line 1497 of file Worksheet.php.

$link_type = 0x01 | $absolute

Definition at line 1534 of file Worksheet.php.

$record = 0x01B8

Definition at line 1496 of file Worksheet.php.

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

Definition at line 1512 of file Worksheet.php.

$stream_len = pack("V", strlen($dir_long) + 0x06)

Definition at line 1564 of file Worksheet.php.

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

Definition at line 1567 of file Worksheet.php.

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

Definition at line 1568 of file Worksheet.php.

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

Definition at line 1569 of file Worksheet.php.

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

Definition at line 1570 of file Worksheet.php.

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

Definition at line 1551 of file Worksheet.php.

if ($format==0) $url = preg_replace('[^external:]', '', $url)

Definition at line 1505 of file Worksheet.php.

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

Definition at line 1506 of file Worksheet.php.


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