OpenAPI 1.0

com.aquafold.openapi.data
Interface AQExcelSpreadsheet


public interface AQExcelSpreadsheet

This interface represents an in-memory Excel spreadhseet.


Method Summary
 void addWorksheet(String name)
          Adds a sheet with the given name.
 void clear()
          Clears the spreadsheet.
 void clearCurrentWorksheet()
          Clears the current worksheet.
 int getColumn()
          Returns the current column (0-based).
 String getCurrentWorksheet()
          Returns the current worksheet name.
 int getRow()
          Returns the current row (0-based).
 String[] getWorksheetNames()
          Returns worksheet names in an array.
 void insert(AQDataReader reader, boolean firstLineContainsColumnNames)
          Inserts the data read from the specified reader into the current worksheet, starting with the current row and column.
 void insert(AQDataRow dataRow)
          Inserts the row of values into the current worksheet, starting with the current row and column.
 void insert(AQDataSet dataSet, boolean firstLineContainsColumnNames)
          Inserts the data set into the current worksheet, starting with the current row and column.
 void insertPivotTable(AQPivotDataSet pivotDataSet)
          Creates a new worksheet with the pivot data set inserted.
 void nextRow()
          Advances current row by one.
 void removeWorksheet(int index)
          Removes a worksheet at the specified index.
 void save()
          Saves the spreadsheet.
 void save(String filename)
          Saves the spreadsheet to a new file.
 void setAutoResize(boolean enable)
          When enabled, the cell widths will be resized to fit the contents on the next save() operation.
 void setCell(int row, int column, Object value)
          Sets the cell value at the specified row and column in the current worksheet.
 void setCell(int row, int column, Object value, AQFont font, AQColor backgroundColor, AQColor foregroundColor)
          Sets the cell value, font, background color and foreground color at the specified row and column in the current worksheet.
 void setCell(Object value)
          Sets the cell value at the current row and column in the current worksheet.
 void setColumn(int column)
          Sets the current column (0-based).
 void setCurrentWorksheet(String name)
          Sets the current worksheet.
 void setRow(int row)
          Sets the current row (0-based).
 void setWorksheetName(int index, String name)
          Sets worksheet name.
 

Method Detail

setCell

void setCell(int row,
             int column,
             Object value)
Sets the cell value at the specified row and column in the current worksheet.

Parameters:
row -
column -
value -

setCell

void setCell(int row,
             int column,
             Object value,
             AQFont font,
             AQColor backgroundColor,
             AQColor foregroundColor)
Sets the cell value, font, background color and foreground color at the specified row and column in the current worksheet.

Parameters:
row - row index
column - column index
value - cell value
font - cell font if not null
backgroundColor - cell background color if not null
foregroundColor - cell foreground color if not null

setCell

void setCell(Object value)
Sets the cell value at the current row and column in the current worksheet.

Parameters:
value -

setCurrentWorksheet

void setCurrentWorksheet(String name)
Sets the current worksheet. A new worksheet will be created if none with this name exists.

Parameters:
name -

getCurrentWorksheet

String getCurrentWorksheet()
Returns the current worksheet name.


setRow

void setRow(int row)
Sets the current row (0-based).

Parameters:
row -

getRow

int getRow()
Returns the current row (0-based).


nextRow

void nextRow()
Advances current row by one.


setColumn

void setColumn(int column)
Sets the current column (0-based).

Parameters:
column -

getColumn

int getColumn()
Returns the current column (0-based).


insertPivotTable

void insertPivotTable(AQPivotDataSet pivotDataSet)
                      throws Exception
Creates a new worksheet with the pivot data set inserted.

Parameters:
pivotDataSet -
Throws:
Exception

insert

void insert(AQDataSet dataSet,
            boolean firstLineContainsColumnNames)
            throws Exception
Inserts the data set into the current worksheet, starting with the current row and column.

Parameters:
dataSet -
firstLineContainsColumnNames - When true, the first inserted line will contain column names, if defined.
Throws:
Exception

insert

void insert(AQDataReader reader,
            boolean firstLineContainsColumnNames)
            throws Exception
Inserts the data read from the specified reader into the current worksheet, starting with the current row and column.

Parameters:
reader -
firstLineContainsColumnNames - When true, the first inserted line will contain column names, if defined.
Throws:
Exception

insert

void insert(AQDataRow dataRow)
Inserts the row of values into the current worksheet, starting with the current row and column.

Parameters:
dataRow -

clear

void clear()
Clears the spreadsheet.


clearCurrentWorksheet

void clearCurrentWorksheet()
Clears the current worksheet.


setAutoResize

void setAutoResize(boolean enable)
When enabled, the cell widths will be resized to fit the contents on the next save() operation.


save

void save()
          throws Exception
Saves the spreadsheet.

Throws:
Exception

save

void save(String filename)
          throws Exception
Saves the spreadsheet to a new file. The format (Excel or Excel 2007) will remain the same regardless of the new file extension.

Parameters:
filename -
Throws:
Exception

getWorksheetNames

String[] getWorksheetNames()
Returns worksheet names in an array.


setWorksheetName

void setWorksheetName(int index,
                      String name)
Sets worksheet name.

Parameters:
index - Worksheet index, 0-based.
name - Worksheet name.

addWorksheet

void addWorksheet(String name)
Adds a sheet with the given name.

Parameters:
name - Worksheet name.
See Also:
setCurrentWorksheet(String)

removeWorksheet

void removeWorksheet(int index)
Removes a worksheet at the specified index.

Parameters:
index - Worksheet index.

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.