Public Member Functions | |
ExcelWriterXML_Sheet ($id) | |
Constructor for a new Sheet. | |
getID () | |
Function to get the named value of the Sheet. | |
addError ($function, $message) | |
Adds a format error. | |
getErrors () | |
Returns any errors found in the sheet. | |
convertMysqlDatetime ($datetime) | |
Converts a MySQL type datetime field to a value that can be used within Excel. | |
convertMysqlDate ($datetime) | |
Converts a MySQL type date field to a value that can be used within Excel If the passed value is not valid then the passed string is sent back. | |
convertMysqlTime ($datetime) | |
Converts a MySQL type time field to a value that can be used within Excel If the passed value is not valid then the passed string is sent back. | |
writeFormula ($dataType, $row, $column, $data, $style=null) | |
Writes a formula to a cell From MS Specifies the formula stored in this cell. | |
writeString ($row, $column, $data, $style=null) | |
Writes a string to a cell. | |
writeNumber ($row, $column, $data, $style=null) | |
Writes a number to a cell. | |
writeDateTime ($row, $column, $data, $style=null) | |
Writes a Date/Time to a cell. | |
displayRightToLeft () | |
Displays the sheet in Right to Left format. | |
getSheetXML () | |
Called by the ExcelWriterXML class to get the XML data for this object. | |
cellWidth ($row, $col, $width=48) | |
Alias for function columnWidth() | |
columnWidth ($col, $width=48) | |
Sets the width of a cell. | |
cellHeight ($row, $col, $height=12.5) | |
Alias for function rowHeight() | |
rowHeight ($row, $height=12.5) | |
Sets the height of a cell. | |
addURL ($row, $col, $URL) | |
Makes the target cell a link to a URL. | |
cellMerge ($row, $col, $width=0, $height=0) | |
Merges 2 or more cells. | |
addComment ($row, $col, $comment, $author= 'SYSTEM') | |
Adds a comment to a cell. | |
mysqlQueryToTable ($host, $username, $password, $query) | |
Outputs a MYSQL table or list of tables to an Excel doc. |
Public Attributes | |
$formatErrors = array() |
ExcelWriterXML_Sheet::addComment | ( | $row, | |
$col, | |||
$comment, | |||
$author = 'SYSTEM' |
|||
) |
Adds a comment to a cell.
integer | $row | Row, based upon a "1" based array |
integer | $col | Column, based upon a "1" based array |
string | $comment | The comment to be displayed on the cell |
string | $author | The comment will show a bold header displaying the author |
ExcelWriterXML_Sheet::addError | ( | $function, | |
$message | |||
) |
Adds a format error.
When the document is generated if there are any errors they will be listed on a seperate sheet.
string | $function | The name of the function that was called |
string | $message | Details of the error |
ExcelWriterXML_Sheet::addURL | ( | $row, | |
$col, | |||
$URL | |||
) |
Makes the target cell a link to a URL.
integer | $row | Row, based upon a "1" based array |
integer | $col | Column, based upon a "1" based array |
string | $URL | The URL that the link should point to |
ExcelWriterXML_Sheet::cellMerge | ( | $row, | |
$col, | |||
$width = 0 , |
|||
$height = 0 |
|||
) |
Merges 2 or more cells.
The function acts like a bounding box, with the row and column defining the upper left corner, and the width and height extending the box. If width or height are zero (or ommitted) then the function does nothing.
ExcelWriterXML_Sheet::columnWidth | ( | $col, | |
$width = 48 |
|||
) |
Sets the width of a cell.
Sets the width of the column that the cell resides in. Cell width of zero effectively hides the column
integer | $col | Column, based upon a "1" based array |
mixed | $width | Width of the cell/column, default is 48 |
ExcelWriterXML_Sheet::convertMysqlDate | ( | $datetime | ) |
Converts a MySQL type date field to a value that can be used within Excel If the passed value is not valid then the passed string is sent back.
string | $datetime | Value must in in the format "yyyy-mm-dd hh:ii:ss" or "yyyy-mm-dd" |
ExcelWriterXML_Sheet::convertMysqlDatetime | ( | $datetime | ) |
Converts a MySQL type datetime field to a value that can be used within Excel.
If the passed value is not valid then the passed string is sent back.
string | $datetime | Value must in in the format "yyyy-mm-dd hh:ii:ss" |
ExcelWriterXML_Sheet::convertMysqlTime | ( | $datetime | ) |
Converts a MySQL type time field to a value that can be used within Excel If the passed value is not valid then the passed string is sent back.
string | $datetime | Value must in in the format "yyyy-mm-dd hh:ii:ss" or "hh:ii:ss" |
ExcelWriterXML_Sheet::ExcelWriterXML_Sheet | ( | $id | ) |
Constructor for a new Sheet.
string | $id | The name of the sheet to be referenced within the spreadsheet |
ExcelWriterXML_Sheet::getErrors | ( | ) |
Returns any errors found in the sheet.
ExcelWriterXML_Sheet::getID | ( | ) |
Function to get the named value of the Sheet.
ExcelWriterXML_Sheet::getSheetXML | ( | ) |
Called by the ExcelWriterXML class to get the XML data for this object.
ExcelWriterXML_Sheet::mysqlQueryToTable | ( | $host, | |
$username, | |||
$password, | |||
$query | |||
) |
Outputs a MYSQL table or list of tables to an Excel doc.
string | $host | MySQL host to connect to |
string | $username | Username to connect with |
string | $password | Password to connect with |
string | $db | Database to use |
mixed | $table | If string, out specific table. If array, each table will have it's own sheet |
ExcelWriterXML_Sheet::rowHeight | ( | $row, | |
$height = 12.5 |
|||
) |
Sets the height of a cell.
Sets the height of the column that the cell resides in. Cell height of zero effectively hides the row
integer | $row | Row, based upon a "1" based array |
integer | $col | Column, based upon a "1" based array |
mixed | $height | Height of the cell/column, default is 12.5 |
ExcelWriterXML_Sheet::writeDateTime | ( | $row, | |
$column, | |||
$data, | |||
$style = null |
|||
) |
Writes a Date/Time to a cell.
If data is not valid the function will write the passed value as a string.
integer | $row | Row, based upon a "1" based array |
integer | $column | Column, based upon a "1" based array |
string | $data | Date or Time data to be written to a cell. This must be in the format "yyyy-mm-ddThh:ii:ss.000" for Excel to recognize it. |
mixed | $style | Named style, or style reference to be applied to the cell |
ExcelWriterXML_Sheet::writeFormula | ( | $dataType, | |
$row, | |||
$column, | |||
$data, | |||
$style = null |
|||
) |
Writes a formula to a cell From MS Specifies the formula stored in this cell.
All formulas are persisted in R1C1 notation because they are significantly easier to parse and generate than A1-style formulas. The formula is calculated upon reload unless calculation is set to manual. Recalculation of the formula overrides the value in this cell's Value attribute.
string | $dataType | Type of data that the formula should generate, "String" "Number" "DateTime" |
integer | $row | Row, based upon a "1" based array |
integer | $column | Column, based upon a "1" based array |
string | $data | Formula data to be written to a cell |
mixed | $style | Named style, or style reference to be applied to the cell |
ExcelWriterXML_Sheet::writeNumber | ( | $row, | |
$column, | |||
$data, | |||
$style = null |
|||
) |
Writes a number to a cell.
If the data is not numeric then the function will write the data as a string.
integer | $row | Row, based upon a "1" based array |
integer | $column | Column, based upon a "1" based array |
mixed | $data | Number data to be written to a cell |
mixed | $style | Named style, or style reference to be applied to the cell |
ExcelWriterXML_Sheet::writeString | ( | $row, | |
$column, | |||
$data, | |||
$style = null |
|||
) |
Writes a string to a cell.
integer | $row | Row, based upon a "1" based array |
integer | $column | Column, based upon a "1" based array |
string | $data | String data to be written to a cell |
mixed | $style | Named style, or style reference to be applied to the cell |