FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
ExcelWriterXML_Sheet Class Reference

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

Member Function Documentation

ExcelWriterXML_Sheet::addComment (   $row,
  $col,
  $comment,
  $author = 'SYSTEM' 
)

Adds a comment to a cell.

Parameters
integer$rowRow, based upon a "1" based array
integer$colColumn, based upon a "1" based array
string$commentThe comment to be displayed on the cell
string$authorThe 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.

Parameters
string$functionThe name of the function that was called
string$messageDetails of the error
ExcelWriterXML_Sheet::addURL (   $row,
  $col,
  $URL 
)

Makes the target cell a link to a URL.

Parameters
integer$rowRow, based upon a "1" based array
integer$colColumn, based upon a "1" based array
string$URLThe 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.

Parameters
integer$rowRow, based upon a "1" based array
integer$colColumn, based upon a "1" based array
integer$widthNumber of cells to the right to merge with
integer$heightNumber of cells down to merge with
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

Parameters
integer$colColumn, based upon a "1" based array
mixed$widthWidth 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.

Parameters
string$datetimeValue must in in the format "yyyy-mm-dd hh:ii:ss" or "yyyy-mm-dd"
Returns
string Value in the Excel format "yyyy-mm-ddT00:00:00.000"
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.

Parameters
string$datetimeValue must in in the format "yyyy-mm-dd hh:ii:ss"
Returns
string Value in the Excel format "yyyy-mm-ddThh:ii:ss.000"
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.

Parameters
string$datetimeValue must in in the format "yyyy-mm-dd hh:ii:ss" or "hh:ii:ss"
Returns
string Value in the Excel format "1899-12-31Thh:ii:ss.000"
ExcelWriterXML_Sheet::ExcelWriterXML_Sheet (   $id)

Constructor for a new Sheet.

Parameters
string$idThe name of the sheet to be referenced within the spreadsheet
ExcelWriterXML_Sheet::getErrors ( )

Returns any errors found in the sheet.

Returns
mixed Array of errors if they exist, otherwise false
ExcelWriterXML_Sheet::getID ( )

Function to get the named value of the Sheet.

Returns
string Name of the Sheet
ExcelWriterXML_Sheet::getSheetXML ( )

Called by the ExcelWriterXML class to get the XML data for this object.

Returns
string Contains only the XML data for the sheet
ExcelWriterXML_Sheet::mysqlQueryToTable (   $host,
  $username,
  $password,
  $query 
)

Outputs a MYSQL table or list of tables to an Excel doc.

Parameters
string$hostMySQL host to connect to
string$usernameUsername to connect with
string$passwordPassword to connect with
string$dbDatabase to use
mixed$tableIf 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

Parameters
integer$rowRow, based upon a "1" based array
integer$colColumn, based upon a "1" based array
mixed$heightHeight 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.

See Also
writeData()
Parameters
integer$rowRow, based upon a "1" based array
integer$columnColumn, based upon a "1" based array
string$dataDate 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$styleNamed 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.

See Also
writeFormula()
Parameters
string$dataTypeType of data that the formula should generate, "String" "Number" "DateTime"
integer$rowRow, based upon a "1" based array
integer$columnColumn, based upon a "1" based array
string$dataFormula data to be written to a cell
mixed$styleNamed 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.

See Also
writeData()
Parameters
integer$rowRow, based upon a "1" based array
integer$columnColumn, based upon a "1" based array
mixed$dataNumber data to be written to a cell
mixed$styleNamed style, or style reference to be applied to the cell
ExcelWriterXML_Sheet::writeString (   $row,
  $column,
  $data,
  $style = null 
)

Writes a string to a cell.

See Also
writeData()
Parameters
integer$rowRow, based upon a "1" based array
integer$columnColumn, based upon a "1" based array
string$dataString data to be written to a cell
mixed$styleNamed style, or style reference to be applied to the cell

The documentation for this class was generated from the following file: