|
Moodle
2.2.1
http://www.collinsharper.com
|
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) | |
Definition at line 45 of file Worksheet.php.
| _append | ( | $ | data | ) |
Store Worksheet data in memory using the parent's class append() or to a temporary file, the default.
| string | $data | The binary data to append |
Definition at line 846 of file Worksheet.php.

| _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).
| string | $cell | The cell reference. |
Definition at line 905 of file Worksheet.php.

| _encode_password | ( | $ | plaintext | ) |
Based on the algorithm provided by Daniel Rentz of OpenOffice.
| string | $plaintext | The password to be encoded in plaintext. |
Definition at line 935 of file Worksheet.php.

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

| _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
| integer | $col_start | Col containing upper left corner of object |
| integer | $row_start | Row containing top left corner of object |
| integer | $x1 | Distance to left side of object |
| integer | $y1 | Distance to top of object |
| integer | $width | Width of image frame |
| integer | $height | Height 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.
| string | $bitmap | The bitmap to process |
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.
| array | $col_array | This 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.

| _store_defcol | ( | ) |
Write BIFF record DEFCOLWIDTH if COLINFO records are in use.
Definition at line 1798 of file Worksheet.php.

Writes Excel DIMENSIONS to define the area in which there is data.
Definition at line 1736 of file Worksheet.php.

| _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.
| integer | $count | The number of external sheet references in this worksheet |
Definition at line 1920 of file Worksheet.php.

| _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.
| string | $sheetname | The name of a external worksheet |
Definition at line 1938 of file Worksheet.php.

| _store_gridset | ( | ) |
Write the GRIDSET BIFF record. Must be used in conjunction with the PRINTGRIDLINES record.
Definition at line 2314 of file Worksheet.php.

| _store_hbreak | ( | ) |
Write the HORIZONTALPAGEBREAKS BIFF record.
Definition at line 2354 of file Worksheet.php.

Store the BOTTOMMARGIN BIFF record.
Definition at line 2229 of file Worksheet.php.

Store the LEFTMARGIN BIFF record.
Definition at line 2169 of file Worksheet.php.

Store the RIGHTMARGIN BIFF record.
Definition at line 2189 of file Worksheet.php.

Store the TOPMARGIN BIFF record.
Definition at line 2209 of file Worksheet.php.

| _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.
| integer | $colL | Column containing upper left corner of object |
| integer | $dxL | Distance from left side of cell |
| integer | $rwT | Row containing top left corner of object |
| integer | $dyT | Distance from top of cell |
| integer | $colR | Column containing lower right corner of object |
| integer | $dxR | Distance from right of cell |
| integer | $rwB | Row containing bottom right corner of object |
| integer | $dyB | Distance 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.
| array | $panes | This 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.

| _store_password | ( | ) |
Write the worksheet PASSWORD record.
Definition at line 2443 of file Worksheet.php.

Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the GRIDSET record.
Definition at line 2298 of file Worksheet.php.

Write the PRINTHEADERS BIFF record.
Definition at line 2282 of file Worksheet.php.

| _store_protect | ( | ) |
Set the Biff PROTECT record to indicate that the worksheet is protected.
Definition at line 2422 of file Worksheet.php.

| _store_selection | ( | $ | array | ) |
Write BIFF record SELECTION.
| array | $array | array containing ($rwFirst,$colFirst,$rwLast,$colLast) |
Definition at line 1869 of file Worksheet.php.

| _store_setup | ( | ) |
Store the page setup SETUP BIFF record.
Definition at line 2044 of file Worksheet.php.

| _store_vbreak | ( | ) |
Write the VERTICALPAGEBREAKS BIFF record.
Definition at line 2387 of file Worksheet.php.

| _store_window2 | ( | ) |
Write BIFF record Window2.
Definition at line 1755 of file Worksheet.php.

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

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

| _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").
| string | $cell | The cell reference. Or range of cells. |
Definition at line 871 of file Worksheet.php.

| _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.
| integer | $row1 | Start row |
| integer | $col1 | Start column |
| integer | $row2 | End row |
| integer | $col2 | End column |
| string | $url | URL string |
| string | $str | Alternative label |
| mixed | $format | The cell format |
Definition at line 1488 of file Worksheet.php.

| _write_url_internal | ( | $ | row1, |
| $ | col1, | ||
| $ | row2, | ||
| $ | col2, | ||
| $ | url, | ||
| $ | str, | ||
| $ | format = 0 |
||
| ) |
Used to write internal reference hyperlinks such as "Sheet1!A1".
| integer | $row1 | Start row |
| integer | $col1 | Start column |
| integer | $row2 | End row |
| integer | $col2 | End column |
| string | $url | URL string |
| string | $str | Alternative label |
| mixed | $format | The cell format |
Definition at line 1424 of file Worksheet.php.


| _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.
| integer | $row1 | Start row |
| integer | $col1 | Start column |
| integer | $row2 | End row |
| integer | $col2 | End column |
| string | $url | URL string |
| string | $string | Alternative label |
| mixed | $format | The cell format |
Definition at line 1339 of file Worksheet.php.


| _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.
| integer | $row1 | Start row |
| integer | $col1 | Start column |
| integer | $row2 | End row |
| integer | $col2 | End column |
| string | $url | URL string |
| string | $str | Alternative label |
| mixed | $format | The cell format |
Definition at line 1366 of file Worksheet.php.


| _XF | ( | &$ | format | ) |
Returns an index to the XF record in the workbook
| mixed | $format | The optional XF format |
Definition at line 820 of file Worksheet.php.

| 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
| integer | $center | the 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
| integer | $center | the 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
| array | $sheetnames | The array of sheetnames from the Workbook this worksheet belongs to |
Definition at line 163 of file Worksheet.php.

| 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
| integer | $width | Maximun width of printed area in pages |
| integer | $heigth | Maximun heigth of printed area in pages |
Definition at line 682 of file Worksheet.php.
| freeze_panes | ( | $ | panes | ) |
Set panes and mark them as frozen.
public
| array | $panes | This 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.
Definition at line 277 of file Worksheet.php.
| get_name | ( | ) |
Retrieve the worksheet name. This is usefull when creating worksheets without a name.
public
Definition at line 266 of file Worksheet.php.
| hide_gridlines | ( | ) |
Set the option to hide gridlines on the printed page.
public
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
| integer | $row | The row we are going to insert the bitmap into |
| integer | $col | The column we are going to insert the bitmap into |
| string | $bitmap | The bitmap filename |
| integer | $x | The horizontal position (offset) of the image inside the cell. |
| integer | $y | The vertical position (offset) of the image inside the cell. |
| integer | $scale_x | The horizontal scale |
| integer | $scale_y | The 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
| integer | $first_row | First row of the area to merge |
| integer | $first_col | First column of the area to merge |
| integer | $last_row | Last row of the area to merge |
| integer | $last_col | Last 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
| integer | $first_row | First row of the area to print |
| integer | $first_col | First column of the area to print |
| integer | $last_row | Last row of the area to print |
| integer | $last_col | Last 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
| integer | Whether 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
| string | $password | The password to use for protecting the sheet. |
Definition at line 344 of file Worksheet.php.

| 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
| integer | $first_col | First column to repeat |
| integer | $last_col | Last 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
| integer | $first_row | First row to repeat |
| integer | $last_row | Last 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
| integer | $firstcol | first column on the range |
| integer | $lastcol | last column on the range |
| integer | $width | width to set |
| mixed | $format | The optional XF format to apply to the columns |
| integer | $hidden | The optional hidden atribute |
Definition at line 361 of file Worksheet.php.
| set_first_sheet | ( | ) |
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
| string | $string | The footer text |
| float | $margin | optional 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
| array | $breaks | Array 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
| string | $string | The header text |
| float | $margin | optional head margin in inches. |
Definition at line 461 of file Worksheet.php.
| set_landscape | ( | ) |
| set_margin_bottom | ( | $ | margin = 1.00 | ) |
Set the bottom margin in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 587 of file Worksheet.php.

| set_margin_left | ( | $ | margin = 0.75 | ) |
Set the left margin in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 554 of file Worksheet.php.

| set_margin_right | ( | $ | margin = 0.75 | ) |
Set the right margin in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 565 of file Worksheet.php.

| set_margin_top | ( | $ | margin = 1.00 | ) |
Set the top margin in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 576 of file Worksheet.php.

| set_margins | ( | $ | margin | ) |
Set all the page margins to the same value in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 516 of file Worksheet.php.

| set_margins_LR | ( | $ | margin | ) |
Set the left and right margins to the same value in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 530 of file Worksheet.php.

| set_margins_TB | ( | $ | margin | ) |
Set the top and bottom margins to the same value in inches.
public
| float | $margin | The margin to set in inches |
Definition at line 542 of file Worksheet.php.

| set_paper | ( | $ | size = 0 | ) |
Set the paper type. Ex. 1 = US Letter, 9 = A4
public
| integer | $size | The type of paper size to use |
Definition at line 448 of file Worksheet.php.
| set_portrait | ( | ) |
| set_print_scale | ( | $ | scale = 100 | ) |
Set the scale factor for the printed page. It turns off the "fit to page" option
public
| integer | $scale | The 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
| integer | $row | The row to set |
| integer | $height | Height we are giving to the row. Use NULL to set XF without setting height |
| mixed | $format | XF 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
| integer | $first_row | first row in the selected quadrant |
| integer | $first_column | first column in the selected quadrant |
| integer | $last_row | last row in the selected quadrant |
| integer | $last_column | last column in the selected quadrant |
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
| array | $breaks | Array containing the vertical page breaks |
Definition at line 710 of file Worksheet.php.
| set_zoom | ( | $ | scale = 100 | ) |
Set the worksheet zoom factor.
public
| integer | $scale | The 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.
| integer | $col | The column |
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).
| integer | $row | The row |
Definition at line 2635 of file Worksheet.php.
| store_footer | ( | ) |
Store the footer caption BIFF record.
Definition at line 2121 of file Worksheet.php.

| store_hcenter | ( | ) |
Store the horizontal centering HCENTER BIFF record.
Definition at line 2138 of file Worksheet.php.

| store_header | ( | ) |
Store the header caption BIFF record.
Definition at line 2104 of file Worksheet.php.

| store_vcenter | ( | ) |
Store the vertical centering VCENTER BIFF record.
Definition at line 2154 of file Worksheet.php.

| thaw_panes | ( | $ | panes | ) |
Set panes and mark them as unfrozen.
public
| array | $panes | This 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
| string | $name | The name of the new worksheet |
| integer | $index | The index of the new worksheet |
| mixed | &$activesheet | The current activesheet of the workbook we belong to |
| mixed | &$firstsheet | The first worksheet in the workbook we belong to |
| mixed | &$url_format | The default format for hyperlinks |
| mixed | &$parser | The formula parser created for the Workbook |
Definition at line 58 of file Worksheet.php.

| write | ( | $ | row, |
| $ | col, | ||
| $ | token, | ||
| $ | format = 0 |
||
| ) |
Map to the appropriate write method acording to the token recieved.
public
| integer | $row | The row of the cell we are writing to |
| integer | $col | The column of the cell we are writing to |
| mixed | $token | What we are writing |
| mixed | $format | The optional format to apply to the cell |
Definition at line 767 of file Worksheet.php.

| 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
| integer | $row | Zero indexed row |
| integer | $col | Zero indexed column |
| mixed | $format | The XF format |
Definition at line 1167 of file Worksheet.php.


| 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
| integer | $row | Zero indexed row |
| integer | $col | Zero indexed column |
| string | $formula | The formula text string |
| mixed | $format | The optional XF format |
Definition at line 1225 of file Worksheet.php.


| 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
| integer | $row | Zero indexed row |
| integer | $col | Zero indexed column |
| string | $note | The note to write |
Definition at line 1099 of file Worksheet.php.

| 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
| integer | $row | Zero indexed row |
| integer | $col | Zero indexed column |
| float | $num | The number to write |
| mixed | $format | The optional XF format |
Definition at line 982 of file Worksheet.php.


| 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
| integer | $row | Zero indexed row |
| integer | $col | Zero indexed column |
| string | $str | The string to write |
| mixed | $format | The XF format for the cell |
Definition at line 1041 of file Worksheet.php.


| 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
| integer | $row | Row |
| integer | $col | Column |
| string | $url | URL string |
| string | $string | Alternative label |
| mixed | $format | The cell format |
Definition at line 1316 of file Worksheet.php.


| if ($str_error==-2) $absolute = 0x02 |
Definition at line 1522 of file Worksheet.php.
| $data |
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.
Definition at line 1505 of file Worksheet.php.
Definition at line 1506 of file Worksheet.php.