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

Public Member Functions

 ExcelWriterXML ($fileName= 'file.xml')
 Constructor for the ExcelWriterXML class.
 overwriteFile ($overwrite=true)
 Whether or not to overwrite a file (when writing to disk)
 showErrorSheet ($show=true)
 Whether or not to show the sheet containing the Formatting Errors.
 addError ($function, $message)
 Adds a format error.
 sendHeaders ()
 Sends the HTML headers to the client.
 getDefaultStyle ()
 Gets the default style that was created by the contructor.
 addStyle ($id=null)
 Creates a new style within the spreadsheet.
 addSheet ($id=null)
 Creates a new sheet within the spreadsheet At least one sheet is required.
 checkStyleID ($id)
 Checks whether a proposed Style ID has already been used.
 writeData ($target=null)
 Writes the XML data.
 docTitle ($title= '')
 Sets the Title of the document.
 docSubject ($subject= '')
 Sets the Subject of the document.
 docAuthor ($author= '')
 Sets the Author of the document.
 docManager ($manager= '')
 Sets the Manager of the document.
 docCompany ($company= '')
 Sets the Company of the document.
 mysqlTableDump ($host, $username, $password, $db, $table, $alternateName=null)
 Outputs a MYSQL table or list of tables to an Excel doc.

Public Attributes

 $formatErrors = array()

Member Function Documentation

ExcelWriterXML::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::addSheet (   $id = null)

Creates a new sheet within the spreadsheet At least one sheet is required.

Additional sheets cannot have the same name as any other sheet. If a sheet has the same name as another sheet then it will follow the default naming convention as if $id was null

Parameters
string$idThe name of the sheet. If left blank then the sheet will default to "Sheet" + n (e.g. "Sheet1")
Returns
ExcelWriterXML_Sheet Reference to a new sheet class
ExcelWriterXML::addStyle (   $id = null)

Creates a new style within the spreadsheet.

Styles cannot have the same name as any other style. If a style has the same name as another style then it will follow the default naming convention as if $id was null

Parameters
string$idThe name of the style. If left blank then the style will default to "CustomStyle" + n (e.g. "CustomStyle1")
Returns
ExcelWriterXML_Style Reference to a new style class
ExcelWriterXML::checkStyleID (   $id)

Checks whether a proposed Style ID has already been used.

Parameters
string$idThe style id to be checked
Returns
boolean True if the id is unique, false otherwise
ExcelWriterXML::docAuthor (   $author = '')

Sets the Author of the document.

Parameters
string$authorPart of the properties of the document.
ExcelWriterXML::docCompany (   $company = '')

Sets the Company of the document.

Parameters
string$companyPart of the properties of the document.
ExcelWriterXML::docManager (   $manager = '')

Sets the Manager of the document.

Parameters
string$managerPart of the properties of the document.
ExcelWriterXML::docSubject (   $subject = '')

Sets the Subject of the document.

Parameters
string$subjectPart of the properties of the document.
ExcelWriterXML::docTitle (   $title = '')

Sets the Title of the document.

Parameters
string$titlePart of the properties of the document.
ExcelWriterXML::ExcelWriterXML (   $fileName = 'file.xml')

Constructor for the ExcelWriterXML class.

A default style is created, a filename is generated (if not supplied) and the create time of the document is stored.

Parameters
string$fileNameThis is the filename that will be passed to the browser. If not present it will default to "file.xml"
Returns
ExcelWriterXML Instance of the class
ExcelWriterXML::getDefaultStyle ( )

Gets the default style that was created by the contructor.

This is used when modifications to the default style are required.

Returns
ExcelWriterXML_Style Reference to a style class
ExcelWriterXML::mysqlTableDump (   $host,
  $username,
  $password,
  $db,
  $table,
  $alternateName = null 
)

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
mixed$alternateNameFor multiple tables this does nothing. For table, overrides auto naming of the sheet (table name)
ExcelWriterXML::overwriteFile (   $overwrite = true)

Whether or not to overwrite a file (when writing to disk)

Parameters
boolean$overwriteTrue or False
ExcelWriterXML::sendHeaders ( )

Sends the HTML headers to the client.

This is only necessary if the XML doc is to be delivered from the server to the browser.

ExcelWriterXML::showErrorSheet (   $show = true)

Whether or not to show the sheet containing the Formatting Errors.

Parameters
boolean$show
ExcelWriterXML::writeData (   $target = null)

Writes the XML data.

Parameters
string$targetIf left null the function will output to STD OUT (e. g. browser or console)

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