ILIAS
release_4-3 Revision
|
Public Member Functions | |
Spreadsheet_Excel_Writer_Worksheet ($BIFF_version, $name, $index, &$activesheet, &$firstsheet, &$str_total, &$str_unique, &$str_table, &$url_format, &$parser, $tmp_dir) | |
Constructor. | |
_initialize () | |
Open a tmp file to store the majority of the Worksheet data. | |
close ($sheetnames) | |
Add data to the beginning of the workbook (note the reverse order) and to the end of the workbook. | |
getName () | |
Retrieve the worksheet name. | |
getData () | |
Retrieves data from memory in one chunk, or from disk in $buffer sized chunks. | |
setMerge ($first_row, $first_col, $last_row, $last_col) | |
Sets a merged cell range. | |
select () | |
Set this worksheet as a selected worksheet, i.e. | |
activate () | |
Set this worksheet as the active worksheet, i.e. | |
setFirstSheet () | |
Set this worksheet as the first visible sheet. | |
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. | |
setColumn ($firstcol, $lastcol, $width, $format=null, $hidden=0, $level=0) | |
Set the width of a single column or a range of columns. | |
setSelection ($first_row, $first_column, $last_row, $last_column) | |
Set which cell or cells are selected in a worksheet. | |
freezePanes ($panes) | |
Set panes and mark them as frozen. | |
thawPanes ($panes) | |
Set panes and mark them as unfrozen. | |
setPortrait () | |
Set the page orientation as portrait. | |
setLandscape () | |
Set the page orientation as landscape. | |
setPaper ($size=0) | |
Set the paper type. | |
setHeader ($string, $margin=0.50) | |
Set the page header caption and optional margin. | |
setFooter ($string, $margin=0.50) | |
Set the page footer caption and optional margin. | |
centerHorizontally ($center=1) | |
Center the page horinzontally. | |
centerVertically ($center=1) | |
Center the page vertically. | |
setMargins ($margin) | |
Set all the page margins to the same value in inches. | |
setMargins_LR ($margin) | |
Set the left and right margins to the same value in inches. | |
setMargins_TB ($margin) | |
Set the top and bottom margins to the same value in inches. | |
setMarginLeft ($margin=0.75) | |
Set the left margin in inches. | |
setMarginRight ($margin=0.75) | |
Set the right margin in inches. | |
setMarginTop ($margin=1.00) | |
Set the top margin in inches. | |
setMarginBottom ($margin=1.00) | |
Set the bottom margin in inches. | |
repeatRows ($first_row, $last_row=null) | |
Set the rows to repeat at the top of each printed page. | |
repeatColumns ($first_col, $last_col=null) | |
Set the columns to repeat at the left hand side of each printed page. | |
printArea ($first_row, $first_col, $last_row, $last_col) | |
Set the area of each worksheet that will be printed. | |
hideGridlines () | |
Set the option to hide gridlines on the printed page. | |
hideScreenGridlines () | |
Set the option to hide gridlines on the worksheet (as seen on the screen). | |
printRowColHeaders ($print=1) | |
Set the option to print the row and column headers on the printed page. | |
fitToPages ($width, $height) | |
Set the vertical and horizontal number of pages that will define the maximum area printed. | |
setHPagebreaks ($breaks) | |
Store the horizontal page breaks on a worksheet (for printing). | |
setVPagebreaks ($breaks) | |
Store the vertical page breaks on a worksheet (for printing). | |
setZoom ($scale=100) | |
Set the worksheet zoom factor. | |
setPrintScale ($scale=100) | |
Set the scale factor for the printed page. | |
write ($row, $col, $token, $format=null) | |
Map to the appropriate write method acording to the token recieved. | |
writeRow ($row, $col, $val, $format=null) | |
Write an array of values as a row. | |
writeCol ($row, $col, $val, $format=null) | |
Write an array of values as a column. | |
_XF (&$format) | |
Returns an index to the XF record in the workbook. | |
_append ($data) | |
Store Worksheet data in memory using the parent's class append() or to a temporary file, the default. | |
_substituteCellref ($cell) | |
Substitute an Excel cell reference in A1 notation for zero based row and column values in an argument list. | |
_cellToRowcol ($cell) | |
Convert an Excel cell reference in A1 notation to a zero based row and column reference; converts C1 to (0, 2). | |
_encodePassword ($plaintext) | |
Based on the algorithm provided by Daniel Rentz of OpenOffice. | |
setOutline ($visible=true, $symbols_below=true, $symbols_right=true, $auto_style=false) | |
This method sets the properties for outlining and grouping. | |
writeNumber ($row, $col, $num, $format=null) | |
Write a double to the specified row and column (zero indexed). | |
writeString ($row, $col, $str, $format=null) | |
Write a string to the specified row and column (zero indexed). | |
setInputEncoding ($encoding) | |
Sets Input Encoding for writing strings. | |
writeStringBIFF8 ($row, $col, $str, $format=null) | |
Write a string to the specified row and column (zero indexed). | |
_checkRowCol ($row, $col) | |
Check row and col before writing to a cell, and update the sheet's dimensions accordingly. | |
writeNote ($row, $col, $note) | |
Writes a note associated with the cell given by the row and column. | |
writeBlank ($row, $col, $format) | |
Write a blank cell to the specified row and column (zero indexed). | |
writeFormula ($row, $col, $formula, $format=null) | |
Write a formula to the specified row and column (zero indexed). | |
writeUrl ($row, $col, $url, $string= '', $format=null) | |
Write a hyperlink. | |
_writeUrlRange ($row1, $col1, $row2, $col2, $url, $string= '', $format=null) | |
This is the more general form of writeUrl(). | |
_writeUrlWeb ($row1, $col1, $row2, $col2, $url, $str, $format=null) | |
Used to write http, ftp and mailto hyperlinks. | |
_writeUrlInternal ($row1, $col1, $row2, $col2, $url, $str, $format=null) | |
Used to write internal reference hyperlinks such as "Sheet1!A1". | |
_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'. | |
setRow ($row, $height, $format=null, $hidden=false, $level=0) | |
This method is used to set the height and format for a row. | |
_storeDimensions () | |
Writes Excel DIMENSIONS to define the area in which there is data. | |
_storeWindow2 () | |
Write BIFF record Window2. | |
_storeDefcol () | |
Write BIFF record DEFCOLWIDTH if COLINFO records are in use. | |
_storeColinfo ($col_array) | |
Write BIFF record COLINFO to define column widths. | |
_storeSelection ($array) | |
Write BIFF record SELECTION. | |
_storeMergedCells () | |
Store the MERGEDCELLS record for all ranges of merged cells. | |
_storeExterncount ($count) | |
Write BIFF record EXTERNCOUNT to indicate the number of external sheet references in a worksheet. | |
_storeExternsheet ($sheetname) | |
Writes the Excel BIFF EXTERNSHEET record. | |
_storePanes ($panes) | |
Writes the Excel BIFF PANE record. | |
_storeSetup () | |
Store the page setup SETUP BIFF record. | |
_storeHeader () | |
Store the header caption BIFF record. | |
_storeFooter () | |
Store the footer caption BIFF record. | |
_storeHcenter () | |
Store the horizontal centering HCENTER BIFF record. | |
_storeVcenter () | |
Store the vertical centering VCENTER BIFF record. | |
_storeMarginLeft () | |
Store the LEFTMARGIN BIFF record. | |
_storeMarginRight () | |
Store the RIGHTMARGIN BIFF record. | |
_storeMarginTop () | |
Store the TOPMARGIN BIFF record. | |
_storeMarginBottom () | |
Store the BOTTOMMARGIN BIFF record. | |
mergeCells ($first_row, $first_col, $last_row, $last_col) | |
Merges the area given by its arguments. | |
_storePrintHeaders () | |
Write the PRINTHEADERS BIFF record. | |
_storePrintGridlines () | |
Write the PRINTGRIDLINES BIFF record. | |
_storeGridset () | |
Write the GRIDSET BIFF record. | |
_storeGuts () | |
Write the GUTS BIFF record. | |
_storeWsbool () | |
Write the WSBOOL BIFF record, mainly for fit-to-page. | |
_storeHbreak () | |
Write the HORIZONTALPAGEBREAKS BIFF record. | |
_storeVbreak () | |
Write the VERTICALPAGEBREAKS BIFF record. | |
_storeProtect () | |
Set the Biff PROTECT record to indicate that the worksheet is protected. | |
_storePassword () | |
Write the worksheet PASSWORD record. | |
insertBitmap ($row, $col, $bitmap, $x=0, $y=0, $scale_x=1, $scale_y=1) | |
Insert a 24bit bitmap image in a worksheet. | |
_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. | |
_sizeCol ($col) | |
Convert the width of a cell from user's units to pixels. | |
_sizeRow ($row) | |
Convert the height of a cell from user's units to pixels. | |
_storeObjPicture ($colL, $dxL, $rwT, $dyT, $colR, $dxR, $rwB, $dyB) | |
Store the OBJ record that precedes an IMDATA record. | |
_processBitmap ($bitmap) | |
Convert a 24 bit bitmap into the modified internal format used by Windows. | |
_storeZoom () | |
Store the window zoom factor. | |
setValidation ($row1, $col1, $row2, $col2, &$validator) | |
FIXME: add comments. | |
_storeDataValidity () | |
Store the DVAL and DV records. | |
Public Member Functions inherited from Spreadsheet_Excel_Writer_BIFFwriter | |
Spreadsheet_Excel_Writer_BIFFwriter () | |
Constructor. | |
_setByteOrder () | |
Determine the byte order and store it as class data to avoid recalculating it for each call to new(). | |
_prepend ($data) | |
General storage function. | |
_storeBof ($type) | |
Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file. | |
_storeEof () | |
Writes Excel EOF record to indicate the end of a BIFF stream. | |
_addContinue ($data) | |
Excel limits the size of BIFF records. | |
setTempDir ($dir) | |
Sets the temp dir used for storing the OLE file. | |
Public Member Functions inherited from PEAR | |
PEAR ($error_class=null) | |
Constructor. | |
_PEAR () | |
Destructor (the emulated type of...). | |
& | getStaticProperty ($class, $var) |
If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. | |
registerShutdownFunc ($func, $args=array()) | |
Use this function to register a shutdown method for static classes. | |
isError ($data, $code=null) | |
Tell whether a value is a PEAR error. | |
setErrorHandling ($mode=null, $options=null) | |
Sets how errors generated by this object should be handled. | |
expectError ($code= '*') | |
This method is used to tell which errors you expect to get. | |
popExpect () | |
This method pops one element off the expected error codes stack. | |
_checkDelExpect ($error_code) | |
This method checks unsets an error code if available. | |
delExpect ($error_code) | |
This method deletes all occurences of the specified element from the expected error codes stack. | |
& | raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false) |
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. | |
& | throwError ($message=null, $code=null, $userinfo=null) |
Simpler form of raiseError with fewer options. | |
staticPushErrorHandling ($mode, $options=null) | |
staticPopErrorHandling () | |
pushErrorHandling ($mode, $options=null) | |
Push a new error handler on top of the error handler options stack. | |
popErrorHandling () | |
Pop the last error handler used. | |
loadExtension ($ext) | |
OS independant PHP extension load. |
Definition at line 46 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::_append | ( | $data | ) |
Store Worksheet data in memory using the parent's class append() or to a temporary file, the default.
private
string | $data | The binary data to append |
Reimplemented from Spreadsheet_Excel_Writer_BIFFwriter.
Definition at line 1274 of file Worksheet.php.
References $data, and Spreadsheet_Excel_Writer_BIFFwriter\_addContinue().
Referenced by _writeUrlInternal(), _writeUrlWeb(), writeBlank(), writeFormula(), writeNote(), writeNumber(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::_cellToRowcol | ( | $cell | ) |
Convert an Excel cell reference in A1 notation to a zero based row and column reference; converts C1 to (0, 2).
private
string | $cell | The cell reference. |
Definition at line 1334 of file Worksheet.php.
References $row.
Referenced by _substituteCellref().
Spreadsheet_Excel_Writer_Worksheet::_checkRowCol | ( | $row, | |
$col | |||
) |
Check row and col before writing to a cell, and update the sheet's dimensions accordingly.
private
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
Definition at line 1610 of file Worksheet.php.
References $row.
Referenced by writeFormula(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::_encodePassword | ( | $plaintext | ) |
Based on the algorithm provided by Daniel Rentz of OpenOffice.
private
string | $plaintext | The password to be encoded in plaintext. |
Definition at line 1365 of file Worksheet.php.
Referenced by protect().
Spreadsheet_Excel_Writer_Worksheet::_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.
private
Definition at line 478 of file Worksheet.php.
Referenced by Spreadsheet_Excel_Writer_Worksheet().
Spreadsheet_Excel_Writer_Worksheet::_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
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 3192 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::_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
string | $bitmap | The bitmap to process |
Definition at line 3385 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::_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
integer | $col | The column |
Definition at line 3258 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::_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
integer | $row | The row |
Definition at line 3282 of file Worksheet.php.
References $row.
Spreadsheet_Excel_Writer_Worksheet::_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
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. 5 => Optional outline level |
Definition at line 2308 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeDataValidity | ( | ) |
Store the DVAL and DV records.
private
Definition at line 3498 of file Worksheet.php.
References $data.
Spreadsheet_Excel_Writer_Worksheet::_storeDefcol | ( | ) |
Write BIFF record DEFCOLWIDTH if COLINFO records are in use.
private
Definition at line 2282 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeDimensions | ( | ) |
Writes Excel DIMENSIONS to define the area in which there is data.
private
Definition at line 2196 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_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
integer | $count | The number of external sheet references in this worksheet |
Definition at line 2432 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_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
string | $sheetname | The name of a external worksheet |
Definition at line 2451 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeFooter | ( | ) |
Store the footer caption BIFF record.
private
Definition at line 2649 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeGridset | ( | ) |
Write the GRIDSET BIFF record.
Must be used in conjunction with the PRINTGRIDLINES record.
private
Definition at line 2865 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeGuts | ( | ) |
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.
Definition at line 2885 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeHbreak | ( | ) |
Write the HORIZONTALPAGEBREAKS BIFF record.
private
Definition at line 2972 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeHcenter | ( | ) |
Store the horizontal centering HCENTER BIFF record.
private
Definition at line 2677 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeHeader | ( | ) |
Store the header caption BIFF record.
private
Definition at line 2621 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeMarginBottom | ( | ) |
Store the BOTTOMMARGIN BIFF record.
private
Definition at line 2775 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeMarginLeft | ( | ) |
Store the LEFTMARGIN BIFF record.
private
Definition at line 2712 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeMarginRight | ( | ) |
Store the RIGHTMARGIN BIFF record.
private
Definition at line 2733 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeMarginTop | ( | ) |
Store the TOPMARGIN BIFF record.
private
Definition at line 2754 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeMergedCells | ( | ) |
Store the MERGEDCELLS record for all ranges of merged cells.
private
Definition at line 2402 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_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
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 3310 of file Worksheet.php.
References $data.
Spreadsheet_Excel_Writer_Worksheet::_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
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 2488 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storePassword | ( | ) |
Write the worksheet PASSWORD record.
private
Definition at line 3083 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storePrintGridlines | ( | ) |
Write the PRINTGRIDLINES BIFF record.
Must be used in conjunction with the GRIDSET record.
private
Definition at line 2847 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storePrintHeaders | ( | ) |
Write the PRINTHEADERS BIFF record.
private
Definition at line 2829 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeProtect | ( | ) |
Set the Biff PROTECT record to indicate that the worksheet is protected.
private
Definition at line 3060 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeSelection | ( | $array | ) |
Write BIFF record SELECTION.
private
array | $array | array containing ($rwFirst,$colFirst,$rwLast,$colLast) |
Definition at line 2361 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeSetup | ( | ) |
Store the page setup SETUP BIFF record.
private
Definition at line 2560 of file Worksheet.php.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeVbreak | ( | ) |
Write the VERTICALPAGEBREAKS BIFF record.
private
Definition at line 3015 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeVcenter | ( | ) |
Store the vertical centering VCENTER BIFF record.
private
Definition at line 2695 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeWindow2 | ( | ) |
Write BIFF record Window2.
private
Definition at line 2223 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeWsbool | ( | ) |
Write the WSBOOL BIFF record, mainly for fit-to-page.
Used in conjunction with the SETUP record.
private
Definition at line 2930 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_storeZoom | ( | ) |
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 3469 of file Worksheet.php.
References $data.
Referenced by close().
Spreadsheet_Excel_Writer_Worksheet::_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
string | $cell | The cell reference. Or range of cells. |
Definition at line 1298 of file Worksheet.php.
References _cellToRowcol(), PEAR_ERROR_DIE, and PEAR\raiseError().
Spreadsheet_Excel_Writer_Worksheet::_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
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 2013 of file Worksheet.php.
Referenced by _writeUrlRange().
Spreadsheet_Excel_Writer_Worksheet::_writeUrlInternal | ( | $row1, | |
$col1, | |||
$row2, | |||
$col2, | |||
$url, | |||
$str, | |||
$format = null |
|||
) |
Used to write internal reference hyperlinks such as "Sheet1!A1".
private
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 1947 of file Worksheet.php.
References $_url_format, $data, $header, $length, $record, $str_error, $unknown1, $url, _append(), and writeString().
Referenced by _writeUrlRange().
Spreadsheet_Excel_Writer_Worksheet::_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
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 1857 of file Worksheet.php.
References $url, _writeUrlExternal(), _writeUrlInternal(), and _writeUrlWeb().
Referenced by writeUrl().
Spreadsheet_Excel_Writer_Worksheet::_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
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 1887 of file Worksheet.php.
References $_url_format, $data, $header, $length, $record, $str_error, $unknown1, $unknown2, $url, _append(), and writeString().
Referenced by _writeUrlRange().
Spreadsheet_Excel_Writer_Worksheet::_XF | ( | & | $format | ) |
Returns an index to the XF record in the workbook.
private
mixed | &$format | The optional XF format |
Definition at line 1250 of file Worksheet.php.
Referenced by writeBlank(), writeFormula(), writeNumber(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::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 710 of file Worksheet.php.
References $index.
Spreadsheet_Excel_Writer_Worksheet::centerHorizontally | ( | $center = 1 | ) |
Center the page horinzontally.
public
integer | $center | the optional value for centering. Defaults to 1 (center). |
Definition at line 885 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::centerVertically | ( | $center = 1 | ) |
Center the page vertically.
public
integer | $center | the optional value for centering. Defaults to 1 (center). |
Definition at line 896 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::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 518 of file Worksheet.php.
References Spreadsheet_Excel_Writer_BIFFwriter\_storeBof(), _storeColinfo(), _storeDefcol(), _storeDimensions(), Spreadsheet_Excel_Writer_BIFFwriter\_storeEof(), _storeExterncount(), _storeExternsheet(), _storeFooter(), _storeGridset(), _storeGuts(), _storeHbreak(), _storeHcenter(), _storeHeader(), _storeMarginBottom(), _storeMarginLeft(), _storeMarginRight(), _storeMarginTop(), _storeMergedCells(), _storePanes(), _storePassword(), _storePrintGridlines(), _storePrintHeaders(), _storeProtect(), _storeSelection(), _storeSetup(), _storeVbreak(), _storeVcenter(), _storeWindow2(), _storeWsbool(), and _storeZoom().
Spreadsheet_Excel_Writer_Worksheet::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
integer | $width | Maximun width of printed area in pages |
integer | $height | Maximun heigth of printed area in pages |
Definition at line 1075 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::freezePanes | ( | $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 790 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::getData | ( | ) |
Retrieves data from memory in one chunk, or from disk in $buffer sized chunks.
Definition at line 648 of file Worksheet.php.
References Spreadsheet_Excel_Writer_BIFFwriter\$_data, and $_filehandle.
Spreadsheet_Excel_Writer_Worksheet::getName | ( | ) |
Retrieve the worksheet name.
This is usefull when creating worksheets without a name.
public
Definition at line 637 of file Worksheet.php.
References $name.
Spreadsheet_Excel_Writer_Worksheet::hideGridlines | ( | ) |
Set the option to hide gridlines on the printed page.
public
Definition at line 1040 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::hideScreenGridlines | ( | ) |
Set the option to hide gridlines on the worksheet (as seen on the screen).
public
Definition at line 1050 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::insertBitmap | ( | $row, | |
$col, | |||
$bitmap, | |||
$x = 0 , |
|||
$y = 0 , |
|||
$scale_x = 1 , |
|||
$scale_y = 1 |
|||
) |
Insert a 24bit bitmap image in a worksheet.
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 3114 of file Worksheet.php.
References $data, $row, and $size.
Spreadsheet_Excel_Writer_Worksheet::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
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 2802 of file Worksheet.php.
References $data.
Spreadsheet_Excel_Writer_Worksheet::printArea | ( | $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 1026 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::printRowColHeaders | ( | $print = 1 | ) |
Set the option to print the row and column headers on the printed page.
public
integer | Whether to print the headers or not. Defaults to 1 (print). |
Definition at line 1061 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::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 736 of file Worksheet.php.
References _encodePassword().
Spreadsheet_Excel_Writer_Worksheet::repeatColumns | ( | $first_col, | |
$last_col = null |
|||
) |
Set the columns to repeat at the left hand side of each printed page.
public
integer | $first_col | First column to repeat |
integer | $last_col | Last column to repeat. Optional. |
Definition at line 1007 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::repeatRows | ( | $first_row, | |
$last_row = null |
|||
) |
Set the rows to repeat at the top of each printed page.
public
integer | $first_row | First row to repeat |
integer | $last_row | Last row to repeat. Optional. |
Definition at line 990 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::select | ( | ) |
Set this worksheet as a selected worksheet, i.e.
the worksheet has its tab highlighted.
public
Definition at line 698 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setColumn | ( | $firstcol, | |
$lastcol, | |||
$width, | |||
$format = null , |
|||
$hidden = 0 , |
|||
$level = 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 |
integer | $level | The optional outline level |
Definition at line 753 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setFirstSheet | ( | ) |
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 723 of file Worksheet.php.
References $index.
Spreadsheet_Excel_Writer_Worksheet::setFooter | ( | $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 869 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setHeader | ( | $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 852 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setHPagebreaks | ( | $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 1089 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setInputEncoding | ( | $encoding | ) |
Sets Input Encoding for writing strings.
public
string | $encoding | The encoding. Ex: 'UTF-16LE', 'utf-8', 'ISO-859-7' |
Definition at line 1534 of file Worksheet.php.
References PEAR\raiseError().
Spreadsheet_Excel_Writer_Worksheet::setLandscape | ( | ) |
Set the page orientation as landscape.
public
Definition at line 828 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setMarginBottom | ( | $margin = 1.00 | ) |
Set the bottom margin in inches.
public
float | $margin | The margin to set in inches |
Definition at line 978 of file Worksheet.php.
Referenced by setMargins(), and setMargins_TB().
Spreadsheet_Excel_Writer_Worksheet::setMarginLeft | ( | $margin = 0.75 | ) |
Set the left margin in inches.
public
float | $margin | The margin to set in inches |
Definition at line 945 of file Worksheet.php.
Referenced by setMargins(), and setMargins_LR().
Spreadsheet_Excel_Writer_Worksheet::setMarginRight | ( | $margin = 0.75 | ) |
Set the right margin in inches.
public
float | $margin | The margin to set in inches |
Definition at line 956 of file Worksheet.php.
Referenced by setMargins(), and setMargins_LR().
Spreadsheet_Excel_Writer_Worksheet::setMargins | ( | $margin | ) |
Set all the page margins to the same value in inches.
public
float | $margin | The margin to set in inches |
Definition at line 907 of file Worksheet.php.
References setMarginBottom(), setMarginLeft(), setMarginRight(), and setMarginTop().
Spreadsheet_Excel_Writer_Worksheet::setMargins_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 921 of file Worksheet.php.
References setMarginLeft(), and setMarginRight().
Spreadsheet_Excel_Writer_Worksheet::setMargins_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 933 of file Worksheet.php.
References setMarginBottom(), and setMarginTop().
Spreadsheet_Excel_Writer_Worksheet::setMarginTop | ( | $margin = 1.00 | ) |
Set the top margin in inches.
public
float | $margin | The margin to set in inches |
Definition at line 967 of file Worksheet.php.
Referenced by setMargins(), and setMargins_TB().
Spreadsheet_Excel_Writer_Worksheet::setMerge | ( | $first_row, | |
$first_col, | |||
$last_row, | |||
$last_col | |||
) |
Sets a merged cell range.
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 682 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::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.
bool | $visible | |
bool | $symbols_below | |
bool | $symbols_right | |
bool | $auto_style |
Definition at line 1395 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setPaper | ( | $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 839 of file Worksheet.php.
References $size.
Spreadsheet_Excel_Writer_Worksheet::setPortrait | ( | ) |
Set the page orientation as portrait.
public
Definition at line 818 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setPrintScale | ( | $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 1135 of file Worksheet.php.
References PEAR\raiseError().
Spreadsheet_Excel_Writer_Worksheet::setRow | ( | $row, | |
$height, | |||
$format = null , |
|||
$hidden = false , |
|||
$level = 0 |
|||
) |
This method is used to set the height and format for a 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 |
bool | $hidden | The optional hidden attribute |
integer | $level | The optional outline level for row, in range [0,7] |
Definition at line 2143 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setSelection | ( | $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 774 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setValidation | ( | $row1, | |
$col1, | |||
$row2, | |||
$col2, | |||
& | $validator | ||
) |
FIXME: add comments.
Definition at line 3487 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setVPagebreaks | ( | $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 1103 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::setZoom | ( | $scale = 100 | ) |
Set the worksheet zoom factor.
public
integer | $scale | The zoom factor |
Definition at line 1117 of file Worksheet.php.
References PEAR\raiseError().
Spreadsheet_Excel_Writer_Worksheet::Spreadsheet_Excel_Writer_Worksheet | ( | $BIFF_version, | |
$name, | |||
$index, | |||
& | $activesheet, | ||
& | $firstsheet, | ||
& | $str_total, | ||
& | $str_unique, | ||
& | $str_table, | ||
& | $url_format, | ||
& | $parser, | ||
$tmp_dir | |||
) |
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 |
string | $tmp_dir | The path to the directory for temporary files private |
Definition at line 370 of file Worksheet.php.
References $index, $name, _initialize(), and Spreadsheet_Excel_Writer_BIFFwriter\Spreadsheet_Excel_Writer_BIFFwriter().
Spreadsheet_Excel_Writer_Worksheet::thawPanes | ( | $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 807 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::write | ( | $row, | |
$col, | |||
$token, | |||
$format = null |
|||
) |
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 1158 of file Worksheet.php.
References $row, writeBlank(), writeFormula(), writeNumber(), writeString(), and writeUrl().
Referenced by writeCol(), and writeRow().
Spreadsheet_Excel_Writer_Worksheet::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
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
mixed | $format | The XF format |
Definition at line 1702 of file Worksheet.php.
References $data, $header, $length, $record, $row, _append(), and _XF().
Referenced by write().
Spreadsheet_Excel_Writer_Worksheet::writeCol | ( | $row, | |
$col, | |||
$val, | |||
$format = null |
|||
) |
Write an array of values as a column.
public
integer | $row | The first row (uppermost row) we are writing to |
integer | $col | The col we are writing to |
array | $val | The array of values to write |
mixed | $format | The optional format to apply to the cell |
Definition at line 1229 of file Worksheet.php.
Referenced by writeRow().
Spreadsheet_Excel_Writer_Worksheet::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
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 1755 of file Worksheet.php.
References $data, $header, $length, $record, $row, _append(), _checkRowCol(), _XF(), PEAR\isError(), and writeString().
Referenced by write().
Spreadsheet_Excel_Writer_Worksheet::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
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
string | $note | The note to write |
Definition at line 1642 of file Worksheet.php.
References $data, $header, $length, $record, $row, and _append().
Spreadsheet_Excel_Writer_Worksheet::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
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 1430 of file Worksheet.php.
References $data, $header, $length, $record, $row, _append(), and _XF().
Referenced by write().
Spreadsheet_Excel_Writer_Worksheet::writeRow | ( | $row, | |
$col, | |||
$val, | |||
$format = null |
|||
) |
Write an array of values as a row.
public
integer | $row | The row we are writing to |
integer | $col | The first col (leftmost col) we are writing to |
array | $val | The array of values to write |
mixed | $format | The optional format to apply to the cell |
Definition at line 1200 of file Worksheet.php.
References $row, write(), and writeCol().
Spreadsheet_Excel_Writer_Worksheet::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
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 1483 of file Worksheet.php.
References $_xls_strmax, $data, $header, $length, $record, $row, $str_error, _append(), _XF(), and writeStringBIFF8().
Referenced by _writeUrlInternal(), _writeUrlWeb(), write(), and writeFormula().
Spreadsheet_Excel_Writer_Worksheet::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
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 1557 of file Worksheet.php.
References $data, $header, $length, $record, $row, $str_error, _append(), _checkRowCol(), and _XF().
Referenced by writeString().
Spreadsheet_Excel_Writer_Worksheet::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
integer | $row | Row |
integer | $col | Column |
string | $url | URL string |
string | $string | Alternative label |
mixed | $format | The cell format |
Definition at line 1833 of file Worksheet.php.
References $row, $url, and _writeUrlRange().
Referenced by write().
Spreadsheet_Excel_Writer_Worksheet::$_active_pane |
Definition at line 152 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_colinfo |
Definition at line 134 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_dim_colmax |
Definition at line 128 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_dim_colmin |
Definition at line 121 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_dim_rowmax |
Definition at line 114 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_dim_rowmin |
Definition at line 107 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_filehandle |
Definition at line 76 of file Worksheet.php.
Referenced by getData().
Spreadsheet_Excel_Writer_Worksheet::$_fit_height |
Definition at line 326 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_fit_page |
Definition at line 314 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_fit_width |
Definition at line 320 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_footer |
Definition at line 188 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_frozen |
Definition at line 158 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_hcenter |
Definition at line 194 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_header |
Definition at line 182 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_input_encoding |
Definition at line 356 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_bottom |
Definition at line 236 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_foot |
Definition at line 212 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_head |
Definition at line 206 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_left |
Definition at line 218 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_right |
Definition at line 224 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_margin_top |
Definition at line 230 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_merged_ranges |
Definition at line 350 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_orientation |
Definition at line 176 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_outline_below |
Definition at line 296 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_outline_on |
Definition at line 284 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_outline_right |
Definition at line 302 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_outline_row_level |
Definition at line 308 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_outline_style |
Definition at line 290 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_panes |
Definition at line 146 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_paper_size |
Definition at line 170 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_parser |
Definition at line 70 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_selection |
Definition at line 140 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_str_table |
Definition at line 344 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_str_total |
Definition at line 332 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_str_unique |
Definition at line 338 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_url_format |
Definition at line 64 of file Worksheet.php.
Referenced by _writeUrlInternal(), and _writeUrlWeb().
Spreadsheet_Excel_Writer_Worksheet::$_using_tmpfile |
Definition at line 82 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_vcenter |
Definition at line 200 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_xls_colmax |
Definition at line 94 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_xls_rowmax |
Definition at line 88 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$_xls_strmax |
Definition at line 100 of file Worksheet.php.
Referenced by writeString().
if (($str_error==-2) or($str_error==-3)) Spreadsheet_Excel_Writer_Worksheet::$absolute = 0x02 |
Definition at line 2047 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$data |
Definition at line 2107 of file Worksheet.php.
Referenced by _append(), _writeUrlInternal(), _writeUrlWeb(), writeBlank(), writeFormula(), writeNote(), writeNumber(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::$dir_long = $url |
Definition at line 2074 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$dir_long_len = pack("V", strlen($dir_long) ) |
Definition at line 2097 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$dir_short = "\0" |
Definition at line 2089 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$dir_short_len = pack("V", strlen($dir_short) ) |
Definition at line 2096 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$header = pack("vv", $record, $length) |
Definition at line 2124 of file Worksheet.php.
Referenced by _writeUrlInternal(), _writeUrlWeb(), writeBlank(), writeFormula(), writeNote(), writeNumber(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::$index |
Definition at line 58 of file Worksheet.php.
Referenced by activate(), setFirstSheet(), and Spreadsheet_Excel_Writer_Worksheet().
Spreadsheet_Excel_Writer_Worksheet::$length = 0x00000 |
Definition at line 2022 of file Worksheet.php.
Referenced by _writeUrlInternal(), _writeUrlWeb(), writeBlank(), writeFormula(), writeNote(), writeNumber(), writeString(), and writeStringBIFF8().
if (!preg_match("/\\\/", $url)) if (preg_match("/^\.\.\\\/", $url) Spreadsheet_Excel_Writer_Worksheet::$link_type) = 0x01 | $absolute |
Definition at line 2054 of file Worksheet.php.
if (preg_match("/\#/", $url)) Spreadsheet_Excel_Writer_Worksheet::$link_type = pack("V", $link_type) |
Definition at line 2082 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$name |
Definition at line 52 of file Worksheet.php.
Referenced by getName(), and Spreadsheet_Excel_Writer_Worksheet().
Spreadsheet_Excel_Writer_Worksheet::$print_colmax |
Definition at line 278 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$print_colmin |
Definition at line 272 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$print_rowmax |
Definition at line 266 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$print_rowmin |
Definition at line 260 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$record = 0x01B8 |
Definition at line 2021 of file Worksheet.php.
Referenced by _writeUrlInternal(), _writeUrlWeb(), writeBlank(), writeFormula(), writeNote(), writeNumber(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::$selected |
Definition at line 164 of file Worksheet.php.
if ($str== '') Spreadsheet_Excel_Writer_Worksheet::$str_error = $this->writeString($row1, $col1, $str, $format) |
Definition at line 2037 of file Worksheet.php.
Referenced by _writeUrlInternal(), _writeUrlWeb(), writeString(), and writeStringBIFF8().
Spreadsheet_Excel_Writer_Worksheet::$stream_len = pack("V", 0) |
Definition at line 2098 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$title_colmin |
Definition at line 254 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$title_rowmax |
Definition at line 248 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$title_rowmin |
Definition at line 242 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' ) |
Definition at line 2101 of file Worksheet.php.
Referenced by _writeUrlInternal(), and _writeUrlWeb().
Spreadsheet_Excel_Writer_Worksheet::$unknown2 = pack("H*",'0303000000000000C000000000000046' ) |
Definition at line 2102 of file Worksheet.php.
Referenced by _writeUrlWeb().
Spreadsheet_Excel_Writer_Worksheet::$unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000') |
Definition at line 2103 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$unknown4 = pack("v", 0x03 ) |
Definition at line 2104 of file Worksheet.php.
Spreadsheet_Excel_Writer_Worksheet::$up_count = preg_match_all("/\.\.\\\/", $dir_long, $useless) |
Definition at line 2085 of file Worksheet.php.
if (!$format) Spreadsheet_Excel_Writer_Worksheet::$url = preg_replace('/^external:/', '', $url) |
Definition at line 2030 of file Worksheet.php.
Referenced by _writeUrlInternal(), _writeUrlRange(), _writeUrlWeb(), and writeUrl().
Spreadsheet_Excel_Writer_Worksheet::$url = preg_replace('/\//', "\\", $url) |
Definition at line 2031 of file Worksheet.php.