|
MXUnit 2.1.3 (Generated: 09/27/2012) | ||||
FRAMES |
WEB-INF.cftags.componentmxunit.framework.POIUtility
public class POIUtility
Handles the reading and writing of Microsoft Excel files using POI and ColdFusion.
Constructor Summary | |
---|---|
Init()
Returns an initialized POI Utility instance |
Method Summary | |
---|---|
any |
Debug()
|
private any |
GetCellStyle(any WorkBook, struct CSS)
Takes the standardized CSS object and creates an Excel cell style |
struct |
GetNewSheetStruct()
Returns a default structure of what this Component is expecting for a sheet definition when WRITING Excel files |
private struct |
ParseRawCSS([string CSS=''])
This takes raw HTML-style CSS and returns a default CSS structure with overwritten parsed values |
any |
ReadExcel(string FilePath, [boolean HasHeaderRow='false'], [numeric SheetIndex='-1'])
Reads an Excel file into an array of strutures that contains the Excel file information OR if a specific sheet index is passed in, only that sheet object is returned |
struct |
ReadExcelSheet(any WorkBook, [numeric SheetIndex='0'], [boolean HasHeaderRow='false'])
Takes an Excel workbook and reads the given sheet (by index) into a structure |
void |
WriteExcel(string FilePath, any Sheets, [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
Takes an array of 'Sheet' structure objects and writes each of them to a tab in the Excel file |
void |
WriteExcelSheet(any WorkBook, any Query, [string ColumnList='[runtime expression]'], [string ColumnNames=''], [string SheetName='[runtime expression]'], [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
Writes the given 'Sheet' structure to the given workbook |
void |
WriteSingleExcel(string FilePath, query Query, [string ColumnList='[runtime expression]'], [string ColumnNames=''], [string SheetName='Sheet 1'], [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
Write the given query to an Excel file |
private any |
getSheetColumnNames(any Sheet, boolean HasHeaderRow)
gets or derives the column names for the sheet |
array |
readExcelToArray(string filePath, [boolean hasHeaderRow='false'], [numeric sheetIndex='0'])
returns a 2D array of data |
Methods inherited from class WEB-INF.cftags.component |
---|
|
Constructor Detail |
---|
public Init()
Method Detail |
---|
public any Debug()
private any GetCellStyle(any WorkBook, struct CSS)
WorkBook
CSS
public struct GetNewSheetStruct()
private struct ParseRawCSS([string CSS=''])
CSS
public any ReadExcel(string FilePath, [boolean HasHeaderRow='false'], [numeric SheetIndex='-1'])
FilePath
- The expanded file path of the Excel file.HasHeaderRow
- Flags the Excel files has using the first data row a header column. If so, this column will be excluded from the resultant query.SheetIndex
- If passed in, only that sheet object will be returned (not an array of sheet objects).public struct ReadExcelSheet(any WorkBook, [numeric SheetIndex='0'], [boolean HasHeaderRow='false'])
WorkBook
- This is a workbook object created by the POI API.SheetIndex
- This is the index of the sheet within the passed in workbook. This is a ZERO-based index (coming from a Java object).HasHeaderRow
- This flags the sheet as having a header row or not (if so, it will NOT be read into the query).public void WriteExcel(string FilePath, any Sheets, [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
FilePath
- This is the expanded path of the Excel file.Sheets
- This is an array of the data that is needed for each sheet of the excel OR it is a single Sheet object. Each 'Sheet' will be a structure containing the Query, ColumnList, ColumnNames, and SheetName.Delimiters
- The list of delimiters used for the column list and column name arguments.HeaderCSS
- Defines the limited CSS available for the header row (if a header row is used).RowCSS
- Defines the limited CSS available for the non-header rows.AltRowCSS
- Defines the limited CSS available for the alternate non-header rows. This style overwrites parts of the RowCSS.public void WriteExcelSheet(any WorkBook, any Query, [string ColumnList='[runtime expression]'], [string ColumnNames=''], [string SheetName='[runtime expression]'], [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
WorkBook
- This is the Excel workbook that will create the sheets.Query
- This is the query from which we will get the data.ColumnList
- This is list of columns provided in custom-ordered.ColumnNames
- This the the list of optional header-row column names. If this is not provided, no header row is used.SheetName
- This is the optional name that appears in this sheet's tab.Delimiters
- The list of delimiters used for the column list and column name arguments.HeaderCSS
- Defines the limited CSS available for the header row (if a header row is used).RowCSS
- Defines the limited CSS available for the non-header rows.AltRowCSS
- Defines the limited CSS available for the alternate non-header rows. This style overwrites parts of the RowCSS.public void WriteSingleExcel(string FilePath, query Query, [string ColumnList='[runtime expression]'], [string ColumnNames=''], [string SheetName='Sheet 1'], [string Delimiters=','], [string HeaderCSS=''], [string RowCSS=''], [string AltRowCSS=''])
FilePath
- This is the expanded path of the Excel file.Query
- This is the query from which we will get the data for the Excel file.ColumnList
- This is list of columns provided in custom-order.ColumnNames
- This the the list of optional header-row column names. If this is not provided, no header row is used.SheetName
- This is the optional name that appears in the first (and only) workbook tab.Delimiters
- The list of delimiters used for the column list and column name arguments.HeaderCSS
- Defines the limited CSS available for the header row (if a header row is used).RowCSS
- Defines the limited CSS available for the non-header rows.AltRowCSS
- Defines the limited CSS available for the alternate non-header rows. This style overwrites parts of the RowCSS.private any getSheetColumnNames(any Sheet, boolean HasHeaderRow)
Sheet
HasHeaderRow
public array readExcelToArray(string filePath, [boolean hasHeaderRow='false'], [numeric sheetIndex='0'])
filePath
- full path to filehasHeaderRow
- whether the first row is a header row. If so, the values in the first row will be used as column names; otherwise, columns will be derivedsheetIndex
|
MXUnit 2.1.3 (Generated: 09/27/2012) | ||||
FRAMES |