ExcelWriterXML
[ class tree: ExcelWriterXML ] [ index: ExcelWriterXML ] [ all elements ]

Class: ExcelWriterXML_Sheet

Source Location: /ExcelWriterXML_Sheet.php

Class Overview


Class for generating sheets within the Excel document


Author(s):

  • Robert F Greer

Version:

  • 1.0

Variables

Methods



Class Details



[ Top ]


Class Variables

$formatErrors = array()

[line 51]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor ExcelWriterXML_Sheet [line 64]

ExcelWriterXML_Sheet ExcelWriterXML_Sheet( string $id)

Constructor for a new Sheet



Parameters:

string   $id   The name of the sheet to be referenced within the spreadsheet

[ Top ]

method addComment [line 418]

void addComment( integer $row, integer $col, string $comment, [string $author = 'SYSTEM'])

Adds a comment to a cell



Parameters:

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

[ Top ]

method addError [line 82]

void addError( $function, string $message)

Adds a format error. When the document is generated if there are any errors they will be listed on a seperate sheet.



Tags:

access:  public


Parameters:

string   $message   Details of the error
   $function  

[ Top ]

method addURL [line 381]

void addURL( integer $row, integer $col, string $URL)

Makes the target cell a link to a URL



Parameters:

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

[ Top ]

method cellHeight [line 363]

void cellHeight( $row, $col, [ $height = 12.5])

Alias for function rowHeight()



Parameters:

   $row  
   $col  
   $height  

[ Top ]

method cellMerge [line 393]

void cellMerge( integer $row, integer $col, [integer $width = 0], [integer $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   $row   Row, based upon a "1" based array
integer   $col   Column, based upon a "1" based array
integer   $width   Number of cells to the right to merge with
integer   $height   Number of cells down to merge with

[ Top ]

method cellWidth [line 349]

void cellWidth( $row, $col, [ $width = 48])

Alias for function columnWidth()



Parameters:

   $row  
   $col  
   $width  

[ Top ]

method columnWidth [line 358]

void columnWidth( integer $col, [mixed $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   $col   Column, based upon a "1" based array
mixed   $width   Width of the cell/column, default is 48

[ Top ]

method convertMysqlDate [line 126]

string convertMysqlDate( string $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.



Tags:

return:  Value in the Excel format "yyyy-mm-ddT00:00:00.000"
access:  public


Parameters:

string   $datetime   Value must in in the format "yyyy-mm-dd hh:ii:ss" or "yyyy-mm-dd"

[ Top ]

method convertMysqlDatetime [line 106]

string convertMysqlDatetime( string $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.




Tags:

return:  Value in the Excel format "yyyy-mm-ddThh:ii:ss.000"
access:  public


Parameters:

string   $datetime   Value must in in the format "yyyy-mm-dd hh:ii:ss"

[ Top ]

method convertMysqlTime [line 151]

string convertMysqlTime( string $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.



Tags:

return:  Value in the Excel format "1899-12-31Thh:ii:ss.000"
access:  public


Parameters:

string   $datetime   Value must in in the format "yyyy-mm-dd hh:ii:ss" or "hh:ii:ss"

[ Top ]

method displayRightToLeft [line 286]

void displayRightToLeft( )

Displays the sheet in Right to Left format



Tags:

access:  public


[ Top ]

method getErrors [line 95]

mixed getErrors( )

Returns any errors found in the sheet



Tags:

return:  Array of errors if they exist, otherwise false
access:  public


[ Top ]

method getID [line 72]

string getID( )

Function to get the named value of the Sheet



Tags:

return:  Name of the Sheet


[ Top ]

method getSheetXML [line 294]

string getSheetXML( )

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



Tags:

return:  Contains only the XML data for the sheet
access:  public


[ Top ]

method mysqlQueryToTable [line 433]

void mysqlQueryToTable( string $host, string $username, string $password, $query, string $db, mixed $table)

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



Tags:

access:  public


Parameters:

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

[ Top ]

method rowHeight [line 373]

void rowHeight( integer $row, [mixed $height = 12.5], integer $col)

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

[ Top ]

method writeDateTime [line 244]

void writeDateTime( integer $row, integer $column, string $data, [mixed $style = null])

Writes a Date/Time to a cell.

If data is not valid the function will write the passed value as a string.




Tags:

see:  writeData()
access:  public


Parameters:

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

[ Top ]

method writeFormula [line 187]

void writeFormula( string $dataType, integer $row, integer $column, string $data, [mixed $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.




Tags:

see:  ExcelWriterXML_Sheet::writeFormula()
access:  public


Parameters:

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

[ Top ]

method writeNumber [line 222]

void writeNumber( integer $row, integer $column, mixed $data, [mixed $style = null])

Writes a number to a cell.

If the data is not numeric then the function will write the data as a string.




Tags:

see:  writeData()
access:  public


Parameters:

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

[ Top ]

method writeString [line 207]

void writeString( integer $row, integer $column, string $data, [mixed $style = null])

Writes a string to a cell



Tags:

see:  writeData()
access:  public


Parameters:

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

[ Top ]


Documentation generated on Thu, 25 Feb 2010 16:36:55 -0600 by phpDocumentor 1.4.1