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 | $function | The name of the function that was called |
string | $message | Details 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 | $id | The 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 | $id | The 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 | $id | The 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 | $author | Part of the properties of the document. |
ExcelWriterXML::docCompany |
( |
|
$company = '' | ) |
|
Sets the Company of the document.
- Parameters
-
string | $company | Part of the properties of the document. |
ExcelWriterXML::docManager |
( |
|
$manager = '' | ) |
|
Sets the Manager of the document.
- Parameters
-
string | $manager | Part of the properties of the document. |
ExcelWriterXML::docSubject |
( |
|
$subject = '' | ) |
|
Sets the Subject of the document.
- Parameters
-
string | $subject | Part of the properties of the document. |
ExcelWriterXML::docTitle |
( |
|
$title = '' | ) |
|
Sets the Title of the document.
- Parameters
-
string | $title | Part 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 | $fileName | This 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 | $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 |
mixed | $alternateName | For 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 | $overwrite | True 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
-
ExcelWriterXML::writeData |
( |
|
$target = null | ) |
|
Writes the XML data.
- Parameters
-
string | $target | If 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: