![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.cells.Cells
public class Cells
Encapsulates a collection of Cell objects.
Method Summary | |
---|---|
void |
applyStyle(Style style,
StyleFlag flag,
int startRow,
int endRow,
int startColumn,
int endColumn)
Applies formattings for a range of cells. |
Cell |
checkCell(int rowIndex,
int columnIndex)
Given a row index and column index, checks whether the cell has been defined. |
Cell |
checkCell(java.lang.String cellName)
Given a cell name(like "A1"), checks whether the cell has been defined. |
Column |
checkColumn(int columnIndex)
Given a column index, checks if the column has been defined. |
Row |
checkRow(int rowIndex)
Given a row index, checks if the row has been defined. |
void |
clearContents(CellArea caClearRange)
Clears contents of a range. |
void |
clearContents(int startRow,
int startColumn,
int endRow,
int endColumn)
Clears contents of a range. |
void |
clearFormats(CellArea caClearRange)
Clears formatting of a range. |
void |
clearFormats(int startRow,
int startColumn,
int endRow,
int endColumn)
Clears formatting of a range. |
void |
clearRange(CellArea caClearRange)
Clears contents and formatting of a range. |
void |
clearRange(int startRow,
int startColumn,
int endRow,
int endColumn)
Clears contents and formatting of a range. |
void |
copyCellRange(Cells sourceCells,
int srcRowIndex,
int srcColIndex,
int destRowIndex,
int destColIndex,
int rowCount,
int colCount)
Copys data and formattings of cells in given range. |
void |
copyColumn(Cells sourceCells,
int sourceColumnIndex,
int destinationColumnIndex)
Copys data and formattings of a whole column. |
void |
copyRow(Cells sourceCells,
int sourceRowIndex,
int destinationRowIndex)
Copys data and formattings of a whole column. |
NamedRange |
createNamedRange(java.lang.String name,
int startIndex,
int number,
boolean isVertical)
Creates a NamedRange object from a range of cells. |
NamedRange |
createNamedRange(java.lang.String name,
int startRow,
int startColumn,
int endRow,
int endColumn)
Creates a Range object from a range of cells. |
NamedRange |
createNamedRange(java.lang.String name,
java.lang.String startCellName,
java.lang.String endCellName)
Creates a NamedRange object from a range of cells. |
void |
deleteBlankColumns()
Deletes all blank columns that have no data. |
void |
deleteBlankRows()
Deletes all blank rows that have no data. |
void |
deleteColumns(int startIndex,
int deletedColumns,
boolean bShift)
Removes columns from the worksheet. |
void |
deleteRangeShiftToLeft(int startRowIndex,
int startColIndex,
int endRowIndex,
int endColIndex)
Delete a range and shift cells left. |
void |
deleteRangeShiftUp(int startRowIndex,
int startColIndex,
int endRowIndex,
int endColIndex)
Delete a range and shift cells Up. |
void |
deleteRows(int startIndex,
int deletedRows,
boolean bShift)
Removes rows from the worksheet. |
java.lang.Object[][] |
exportArray(int rowIndex,
int columnIndex,
int rowNum,
int columnNum)
Exports data in the collection to a two-dimension array object. |
Cell |
find(java.lang.String inputString,
Cell previousCell,
FindOptions findOptions)
Finds the cell with the input string with find options. |
Cell |
getCell(int rowIndex,
int columnIndex)
Gets the cell object with the specified row index and column index. |
Cell |
getCell(java.lang.String cellName)
Gets the cell object by the cell name(like "A1"). |
java.util.Iterator<Cell> |
getCellIterator()
Returns an iterator which can iterate all defined cells in this worksheet. |
Cell[][] |
getCells(int startRow,
int startColumn,
int endRow,
int endColumn)
Gets two dimensional array of all the cells(Cell object) in given range. |
Cell[][] |
getCells(int startRow,
int startColumn,
int endRow,
int endColumn,
boolean initCell)
Gets two dimensional array of all the cells(Cell object) in given range. |
Style |
getCellStyle(int rowIndex,
int columnIndex)
Gets the cell's Style by the specified row index and column index. |
Column |
getColumn(int columnIndex)
Gets the column at the given column index. |
Columns |
getColumns()
Gets the collection of Column objects that represents the individual columns in this worksheet. |
float |
getColumnWidth(int columnIndex)
Gets the width of the column at the given column index, in unit of characters using default font. |
float |
getColumnWidthInch(int columnIndex)
Gets the column width, in unit of inches. |
int |
getColumnWidthPixel(int columnIndex)
Gets the column width, in unit of pixels. |
int |
getMaxColumn()
Gets maximum column index of cell which contains data or style. |
int |
getMaxDataColumn()
Gets maximum column index of cell which contains data. |
int |
getMaxDataRow()
Returns maximum row index of cell which contains data. |
int |
getMaxRow()
Returns the last defined row index. |
java.util.ArrayList<CellArea> |
getMergedCells()
Gets the collection of merged cell ranges in the worksheet. |
int |
getMinColumn()
Gets minimum column index of cell which contains data or style. |
int |
getMinRow()
Returns the first defined row index. |
Row |
getRow(int rowIndex)
Gets the row at the specified row index. |
float |
getRowHeight(int row)
Gets the height of the row in points. |
float |
getRowHeightInch(int row)
Sets the row height, in inch. |
int |
getRowHeightPixel(int row)
Sets the row height, in pixels. |
java.util.Iterator<Row> |
getRowIterator()
Returns an iterator which can iterate all defined rows in this worksheet. |
java.util.Iterator<Row> |
getRowIterator(int startRowIndex)
Returns an iterator which can iterate all defined rows in this worksheet from the start row index. |
Rows |
getRows()
Gets the collection of Row objects that represents the individual rows in this worksheet. |
float |
getStandardHeight()
Gets the default row height of the worksheet in points. |
int |
getStandardHeightPixels()
Gets the default row height of the worksheet in pixels. |
float |
getStandardWidth()
Returns the default column width of the worksheet, in unit of characters with default font. |
int |
getStandardWidthPixels()
Returns the default column width of the worksheet, in unit of pixels. |
void |
groupColumns(int startIndex,
int endIndex)
Groups columns. |
void |
groupColumns(int startIndex,
int endIndex,
boolean isHidden)
Groups columns. |
void |
groupRows(int startIndex,
int endIndex)
Groups rows. |
void |
groupRows(int startIndex,
int endIndex,
boolean isHidden)
Groups rows. |
void |
hideColumn(int column)
Hides a column. |
void |
hideRow(int row)
Hides a row. |
void |
importArray(double[][] array,
int firstRow,
int firstColumn)
Imports a two-dimension of double into a worksheet. |
void |
importArray(double[] array,
int firstRow,
int firstColumn,
boolean isVertical)
Imports an array of double into a worksheet. |
void |
importArray(int[][] array,
int firstRow,
int firstColumn)
Imports a two-dimension of integer into a worksheet. |
void |
importArray(int[] array,
int firstRow,
int firstColumn,
boolean isVertical)
Imports an array of integer into a worksheet. |
void |
importArray(java.lang.String[][] array,
int firstRow,
int firstColumn)
Imports a two-dimension of string into a worksheet. |
void |
importArray(java.lang.String[] array,
int firstRow,
int firstColumn,
boolean isVertical)
Imports an array of string into a worksheet. |
void |
importCollection(java.util.Collection collection,
int firstRow,
int firstColumn,
boolean isVertical)
Imports a collection of data into a worksheet. |
void |
importObjectArray(java.lang.Object[][] array,
int firstRow,
int firstColumn)
Imports a two-dimension of data into a worksheet. |
void |
importObjectArray(java.lang.Object[] array,
int firstRow,
int firstColumn,
boolean isVertical)
Imports an array of data into a worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
int rowIndex,
int columnIndex,
boolean isFieldNameShown)
Imports data in a ResultSet object to the worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
int rowIndex,
int columnIndex,
boolean isFieldNameShown,
java.lang.String customDateFormatString,
boolean convertStringToNumber)
Imports data in a ResultSet object to the worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
int rowIndex,
int columnIndex,
int rowNum,
int columnNum,
boolean isFieldNameShown)
Imports data in a ResultSet object to the worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
int rowIndex,
int columnIndex,
int rowNum,
int columnNum,
boolean isFieldNameShown,
java.lang.String customDateFormatString,
boolean convertStringToNumber)
Imports data in a ResultSet object to the worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
java.lang.String startCell,
boolean isFieldNameShown)
Imports data in a ResultSet object to the worksheet. |
int |
importResultSet(java.sql.ResultSet rs,
java.lang.String startCell,
int rowNum,
int columnNum,
boolean isFieldNameShown)
Imports data in a ResultSet object to the worksheet. |
void |
insertColumns(int columnIndex,
int columnNum)
Inserts multiple columns into the worksheet. |
void |
insertRangeShiftDown(int startRowIndex,
int startColIndex,
int endRowIndex,
int endColIndex)
Insert a range and shift cells down. |
void |
insertRangeShiftToRight(int startRowIndex,
int startColIndex,
int endRowIndex,
int endColIndex)
Insert a range and shift cells right. |
void |
insertRows(int rowIndex,
int rowNum)
Inserts multiple rows into the worksheet. |
boolean |
isColumnHidden(int columnIndex)
Checks if the specified column is hidden. |
void |
merge(int startRow,
int startColumn,
int endRow,
int endColumn)
Merges a specified range of cells into a single cell. |
void |
removeCell(int rowIndex,
int columnIndex)
Removes a cell at the specified row index and column index from the worksheet. |
void |
removeCell(java.lang.String cellName)
Removes a cell from the worksheet by the cell name. |
void |
removeRow(int rowIndex)
Removes the row at the given position from the worksheet. |
void |
setColumnHidden(int columnIndex,
boolean isHidden)
Sets whether the specified column to be hidden or not. |
void |
setColumnWidth(int columnIndex,
float columnWidth)
Sets the width of the specified column, in unit of characters using default font. |
void |
setColumnWidthInch(int columnIndex,
double inch)
Sets the column width, in unit of inches. |
void |
setColumnWidthPixel(int columnIndex,
int pixels)
Sets the column width, in unit of pixels. |
void |
setRangeOutlineBorder(int startRow,
int endRow,
int startColumn,
int endColumn,
int borderLineType,
Color borderColor)
Sets outline border for an area of cells. |
void |
setRangeStyle(int startRow,
int endRow,
int startColumn,
int endColumn,
Style style)
Sets a style for an area of cells. |
void |
setRowHeight(int row,
double height)
Sets the row height, in points. |
void |
setRowHeightInch(int row,
double inch)
Sets the row height, in inch. |
void |
setRowHeightPixel(int row,
int pixels)
Sets the row height, in pixel. |
void |
setStandardHeight(float defaultRowHeight)
Sets the default row height of the worksheet, in unit of points. |
void |
setStandardHeightPixels(int pixels)
/** sets the default row height of the worksheet in pixels. |
void |
setStandardWidth(float defaultColumnWidth)
Sets the default column width of the worksheet, in unit of characters using default font. |
void |
setStandardWidthPixels(int pixels)
Sets the default column width of the worksheet, in unit of pixels. |
void |
shiftRows(int startRow,
int endRow,
int shiftSize)
Shifts rows between startRow and endRow upward or downward. |
void |
subtotal(CellArea ca,
int groupBy,
short function,
int[] totalList)
Creates subtotals for the range. |
void |
subtotal(CellArea ca,
int groupBy,
short function,
java.lang.String subTotalHeaderFormat,
java.lang.String grandTotalHeader,
int[] totalList)
Creates subtotals for the range. |
void |
ungroupColumns(int startIndex,
int endIndex)
Ungroups columns. |
void |
ungroupRows(int startIndex,
int endIndex)
Ungroups rows. |
void |
unhideColumn(int column,
double width)
Unhides a column. |
void |
unhideRow(int row,
double height)
Unhides a row. |
void |
unMerge(int startRow,
int startColumn,
int endRow,
int endColumn)
UmMerges a specified range of cells. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Rows getRows()
CellsException
- if the worksheet has been removed from the workbook.public Columns getColumns()
CellsException
- if the worksheet has been removed from the workbook.public Row getRow(int rowIndex)
rowIndex
- row index.
java.lang.IllegalArgumentException
- if index is out of range.
CellsException
- if the worksheet has been removed from the workbook.public Cell getCell(int rowIndex, int columnIndex)
rowIndex
- row indexcolumnIndex
- column index
java.lang.IllegalArgumentException
- if any of the indexes is out of range.
CellsException
- if the worksheet has been removed.public Style getCellStyle(int rowIndex, int columnIndex)
rowIndex
- row indexcolumnIndex
- column index
java.lang.IllegalArgumentException
- if any of the indexes is out of range.
CellsException
- if the worksheet has been removed.public Cell getCell(java.lang.String cellName)
cellName
- cell name.
java.lang.IllegalArgumentException
- if the cell name is invalid.
CellsException
- if the worksheet has been removed from the workbook.public Cell checkCell(java.lang.String cellName)
cellName
- cell name.
java.lang.IllegalArgumentException
- if the cell name is invalid.
CellsException
- if the worksheet has been removed from the workbook.public Cell checkCell(int rowIndex, int columnIndex)
rowIndex
- 0 based row index.columnIndex
- 0 based column index.
java.lang.IllegalArgumentException
- if one of the indexes is out of range.
CellsException
- if the worksheet has been removed from the workbook.public Row checkRow(int rowIndex)
rowIndex
- 0 based row index.
java.lang.IllegalArgumentException
- if row index is out of range.
CellsException
- if the worksheet has been removed from the workbook.public Column checkColumn(int columnIndex)
columnIndex
- 0 based column index.
java.lang.IllegalArgumentException
- if column index is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void insertRows(int rowIndex, int rowNum)
rowIndex
- The row index to insert before.rowNum
- Number of rows to be inserted.
CellsException
- if the worksheet has been removed from the workbook.public void insertColumns(int columnIndex, int columnNum)
columnIndex
- The column index to insert before.columnNum
- Number of columns to be inserted.
CellsException
- if the worksheet has been removed from the workbook.public void shiftRows(int startRow, int endRow, int shiftSize)
startRow
- index of the start row of row range to be shifted.endRow
- index of the end row of row range to be shifted.shiftSize
- number of rows to be shifted (positive: shift rows downward; negative: shift rows upward)public void deleteRows(int startIndex, int deletedRows, boolean bShift)
startIndex
- the first row index to be removed.deletedRows
- Number of rows to be removed.bShift
- whether the rows after the deleted rows should be shifted up.public void deleteColumns(int startIndex, int deletedColumns, boolean bShift)
startIndex
- the first column index to be removed.deletedColumns
- Number of columns to be removed.bShift
- whether the columns after the deleted columns should be shifted left.public void deleteBlankRows()
public void deleteBlankColumns()
public void deleteRangeShiftToLeft(int startRowIndex, int startColIndex, int endRowIndex, int endColIndex)
startRowIndex
- Start row index.startColIndex
- Start column index.endRowIndex
- End row index.endColIndex
- End column index.public void deleteRangeShiftUp(int startRowIndex, int startColIndex, int endRowIndex, int endColIndex)
startRowIndex
- Start row index.startColIndex
- Start column index.endRowIndex
- End row index.endColIndex
- End column index.public void insertRangeShiftDown(int startRowIndex, int startColIndex, int endRowIndex, int endColIndex)
startRowIndex
- Start row index.startColIndex
- Start column index.endRowIndex
- End row index.endColIndex
- End column index.public void insertRangeShiftToRight(int startRowIndex, int startColIndex, int endRowIndex, int endColIndex)
startRowIndex
- Start row index.startColIndex
- Start column index.endRowIndex
- End row index.endColIndex
- End column index.public void removeRow(int rowIndex)
deleteRows(int, int, boolean)
to make more control.
rowIndex
- row index.
java.lang.IllegalArgumentException
- if row index is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void removeCell(java.lang.String cellName)
cellName
- cell name.
java.lang.IllegalArgumentException
- if the cell name is invalid.
CellsException
- if the worksheet has been removed from the workbook.public void removeCell(int rowIndex, int columnIndex)
rowIndex
- row index of the cell.columnIndex
- column Index of the cell.
java.lang.IllegalArgumentException
- if any of the indexes is out of range.
CellsException
- if the worksheet has been removed from the workbook.public float getStandardWidth()
public void setStandardWidth(float defaultColumnWidth)
defaultColumnWidth
- the default column width of the worksheet in characters. 0-255.
java.lang.IllegalArgumentException
- if the given column width is invalid(< 0 or > 255 ).
CellsException
- if the worksheet has been removed from the workbook.public float getStandardHeight()
public int getStandardHeightPixels()
public int getStandardWidthPixels()
public void setStandardWidthPixels(int pixels)
pixels
- the default column width in pixels.public void setStandardHeight(float defaultRowHeight)
defaultRowHeight
- row height in points(0-409).
java.lang.IllegalArgumentException
- if the row height is invalid.
CellsException
- if the worksheet has been removed from the workbook.public void setStandardHeightPixels(int pixels)
pixels
- the default row height in pixels.public void setRowHeight(int row, double height)
row
- row index.height
- the row height
java.lang.IllegalArgumentException
- if the row height is invalid.
CellsException
- if the worksheet has been removed from the workbook.public void setRowHeightInch(int row, double inch)
row
- row indexinch
- the row height in inchpublic void setRowHeightPixel(int row, int pixels)
row
- row indexpixels
- the row height in pixelpublic float getRowHeight(int row)
row
- row index.
java.lang.IllegalArgumentException
- if the row height is invalid.
CellsException
- if the worksheet has been removed from the workbook.public int getRowHeightPixel(int row)
row
- row index
public float getRowHeightInch(int row)
row
- row index
public void setRangeStyle(int startRow, int endRow, int startColumn, int endColumn, Style style)
startRow
- start row index.endRow
- end row index.startColumn
- start column index.endColumn
- end column index.style
- style to set.
java.lang.IllegalArgumentException
- if any of the indexes is out of range, or start index is
greater than end index.
CellsException
- if the worksheet has been removed from the workbook.public void applyStyle(Style style, StyleFlag flag, int startRow, int endRow, int startColumn, int endColumn)
style
- The style object which will be applied.flag
- Flags which indicates applied formatting properties.startRow
- start row index.endRow
- end row index(inclusive).startColumn
- start column index.endColumn
- end column index(inclusive).public void setRangeOutlineBorder(int startRow, int endRow, int startColumn, int endColumn, int borderLineType, Color borderColor)
startRow
- start row index.endRow
- end row index.startColumn
- start column index.endColumn
- end column index.borderLineType
- line type of border. see BorderLineType
borderColor
- color of border
java.lang.IllegalArgumentException
- if any of the indexes is out of range, or start index is
greater than end index.
CellsException
- if the worksheet has been removed from the workbook.public java.util.ArrayList<CellArea> getMergedCells()
public void merge(int startRow, int startColumn, int endRow, int endColumn)
startRow
- row index of the top left cell.startColumn
- column index of the top left cell.endRow
- row index of the bottom right cell.endColumn
- column index of the bottom right cell.
java.lang.IllegalArgumentException
- if any of the indexes is out of range, or start index is
greater than end index.public void unMerge(int startRow, int startColumn, int endRow, int endColumn)
startRow
- row index of the top left cell.startColumn
- column index of the top left cell.endRow
- row index of the bottom right cell.endColumn
- column index of the bottom right cell.public void hideRow(int row)
row
- Row index.
java.lang.IllegalArgumentException
- if row index is out of range.public void unhideRow(int row, double height)
row
- Row index.height
- Row height.
java.lang.IllegalArgumentException
- if row index is out of range.public void hideColumn(int column)
column
- Column index.
java.lang.IllegalArgumentException
- if column index is out of range.public void unhideColumn(int column, double width)
column
- Column index.width
- Column width.
java.lang.IllegalArgumentException
- if column index is out of range.public void groupRows(int startIndex, int endIndex)
startIndex
- The first row index to be grouped.endIndex
- The last row index to be grouped.public void groupRows(int startIndex, int endIndex, boolean isHidden)
startIndex
- The first row index to be grouped.endIndex
- The last row index to be grouped.isHidden
- Specifies if the grouped columns are hidden.public void ungroupRows(int startIndex, int endIndex)
startIndex
- The first row index to be ungrouped.endIndex
- The last row index to be ungrouped.public void groupColumns(int startIndex, int endIndex)
startIndex
- The first column index to be grouped.endIndex
- The last column index to be grouped.public void groupColumns(int startIndex, int endIndex, boolean isHidden)
startIndex
- The first column index to be grouped.endIndex
- The last column index to be grouped.isHidden
- Specifies if the grouped columns are hidden.public void ungroupColumns(int startIndex, int endIndex)
startIndex
- The first column index to be ungrouped.endIndex
- The last column index to be ungrouped.public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown) throws java.sql.SQLException
rs
- the ResultSet object to import from.rowIndex
- start row index in the worksheet.columnIndex
- start column index in the worksheet.rowNum
- number of rows to import.columnNum
- number of columns to import.isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public int importResultSet(java.sql.ResultSet rs, java.lang.String startCell, int rowNum, int columnNum, boolean isFieldNameShown) throws java.sql.SQLException
rs
- the ResultSet object to import from.startCell
- name of start cell to insert the resultset, such as "A1".rowNum
- number of rows to be imported.columnNum
- number of columns to be imported.isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown) throws java.sql.SQLException
rs
- the ResultSet object to import from.rowIndex
- start row index in the worksheet.columnIndex
- start column index in the worksheet.isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public int importResultSet(java.sql.ResultSet rs, java.lang.String startCell, boolean isFieldNameShown) throws java.sql.SQLException
rs
- the ResultSet object to import from.startCell
- name of start cell to insert the resultset, such as "A1".isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, java.lang.String customDateFormatString, boolean convertStringToNumber) throws java.sql.SQLException
rs
- the ResultSet object to import from.rowIndex
- start row index in the worksheet.columnIndex
- start column index in the worksheet.rowNum
- number of rows to import.columnNum
- number of columns to import.isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.customDateFormatString
- Date format string for cells which contain date value.convertStringToNumber
- Indicates if this method will try to convert string to number.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, java.lang.String customDateFormatString, boolean convertStringToNumber) throws java.sql.SQLException
rs
- the ResultSet object to import from.rowIndex
- start row index in the worksheet.columnIndex
- start column index in the worksheet.isFieldNameShown
- Indicates whether the field name of the resultset will be imported
to the first row.customDateFormatString
- Date format string for cells which contain date value.convertStringToNumber
- Indicates if this method will try to convert string to number.
java.sql.SQLException
- if an error occurs while reading from the resultset.
CellsException
- if the worksheet has been removed from the workbook.public void importCollection(java.util.Collection collection, int firstRow, int firstColumn, boolean isVertical)
collection
- Data collection.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.isVertical
- Specifies to import data vertically or horizontally.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(int[] array, int firstRow, int firstColumn, boolean isVertical)
array
- Integer array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.isVertical
- Specifies to import data vertically or horizontally.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(double[] array, int firstRow, int firstColumn, boolean isVertical)
array
- Double array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.isVertical
- Specifies to import data vertically or horizontally.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(java.lang.String[] array, int firstRow, int firstColumn, boolean isVertical)
array
- String array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.isVertical
- Specifies to import data vertically or horizontally.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importObjectArray(java.lang.Object[] array, int firstRow, int firstColumn, boolean isVertical)
Cell.setValue(Object)
.
array
- Data array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.isVertical
- Specifies to import data vertically or horizontally.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the row or column index of the cell to import data in
is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(int[][] array, int firstRow, int firstColumn)
array
- two-dimension integer array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(double[][] array, int firstRow, int firstColumn)
array
- Two-dimension double array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importArray(java.lang.String[][] array, int firstRow, int firstColumn)
array
- Two-dimension String array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public void importObjectArray(java.lang.Object[][] array, int firstRow, int firstColumn)
Cell.setValue(Object)
.
array
- Data array.firstRow
- The row index of the first cell to import in.firstColumn
- The column index of the first cell to import in.
java.lang.IllegalArgumentException
- if firstRow or firstColumn is out of range.
java.lang.IllegalArgumentException
- if the cell to import data in is out of range.
CellsException
- if the worksheet has been removed from the workbook.public java.lang.Object[][] exportArray(int rowIndex, int columnIndex, int rowNum, int columnNum) throws java.sql.SQLException
rowIndex
- start row index in the worksheet to export.columnIndex
- start column index in the worksheet to export.rowNum
- number of rows to export.columnNum
- number of columns to export.
CellsException
- if the worksheet has been removed from the workbook.
java.sql.SQLException
public Cell[][] getCells(int startRow, int startColumn, int endRow, int endColumn, boolean initCell)
startRow
- start row index in the worksheet to export.startColumn
- start column index in the worksheet to export.endRow
- end row index in the worksheet to export.endColumn
- end column index in the worksheet to export.initCell
- whether initialize one Cell if it has not been initialized yet.
For an uninitialized cell in the range, if initCell is true, this cell will be instantiated;
if false, this cell will be left uninitialized, and the corresponding element in returen array is null.
public Cell[][] getCells(int startRow, int startColumn, int endRow, int endColumn)
startRow
- start row index in the worksheet to export.startColumn
- start column index in the worksheet to export.endRow
- end row index in the worksheet to export.endColumn
- end column index in the worksheet to export.
getCells(int, int, int, int, boolean)
public void clearContents(int startRow, int startColumn, int endRow, int endColumn)
startRow
- Start row index.startColumn
- Start column index.endRow
- End row index.endColumn
- End column index.public void clearContents(CellArea caClearRange)
caClearRange
- the range to clear.public void clearFormats(int startRow, int startColumn, int endRow, int endColumn)
startRow
- Start row index.startColumn
- Start column index.endRow
- End row index.endColumn
- End column index.public void clearFormats(CellArea caClearRange)
caClearRange
- the range to clear.public void clearRange(int startRow, int startColumn, int endRow, int endColumn)
startRow
- Start row index.startColumn
- Start column index.endRow
- End row index.endColumn
- End column index.public void clearRange(CellArea caClearRange)
caClearRange
- the range to clear.public void copyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex)
sourceCells
- Source Cells object contains data and formattings to copy.sourceColumnIndex
- Source row index.destinationColumnIndex
- Destination row index.public void copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)
sourceCells
- Source Cells object contains data and formattings to copy.sourceRowIndex
- Source column index.destinationRowIndex
- Destination column index.
java.lang.IllegalArgumentException
- if source or dest row index is out of range.public void copyCellRange(Cells sourceCells, int srcRowIndex, int srcColIndex, int destRowIndex, int destColIndex, int rowCount, int colCount)
sourceCells
- Source Cells object contains data and formattings to copy.srcRowIndex
- the start row index of given range in sourceCells to be copiedsrcColIndex
- the start column index of given range in sourceCells to be copieddestRowIndex
- the destination row index where the start row of source to be copied into.destColIndex
- the destination column index where the start column of to be source copied into.rowCount
- count of rows to be copiedcolCount
- count of columns to be copiedpublic int getMinRow()
public int getMaxRow()
public int getMaxDataRow()
public int getMinColumn()
public int getMaxColumn()
public int getMaxDataColumn()
public java.util.Iterator<Row> getRowIterator()
CellsException
- if the worksheet has been removed from the workbook.public java.util.Iterator<Row> getRowIterator(int startRowIndex)
startRowIndex
- Starts from row index.
CellsException
- if the worksheet has been removed from the workbook.public java.util.Iterator<Cell> getCellIterator()
public float getColumnWidth(int columnIndex)
columnIndex
- column index.
java.lang.IllegalArgumentException
- if column index is out of range.public Column getColumn(int columnIndex)
columnIndex
- column index.
java.lang.IllegalArgumentException
- if column index is out of range.public Cell find(java.lang.String inputString, Cell previousCell, FindOptions findOptions)
inputString
- The string to search for.previousCell
- Previous cell with the same string.
This parameter can be set to null if seaching from the start.findOptions
- find options
public int getColumnWidthPixel(int columnIndex)
columnIndex
-
public float getColumnWidthInch(int columnIndex)
columnIndex
- column index.
public void setColumnWidth(int columnIndex, float columnWidth)
columnIndex
- column index.columnWidth
- column width in characters(0-255).
java.lang.IllegalArgumentException
- if either column index or column width is invalid.
CellsException
- if the worksheet has been removed from the workbook.public void setColumnWidthInch(int columnIndex, double inch)
columnIndex
- column index.inch
- column width in inchpublic void setColumnWidthPixel(int columnIndex, int pixels)
columnIndex
- column index.pixels
- column width in pixelspublic boolean isColumnHidden(int columnIndex)
columnIndex
- column index.
java.lang.IllegalArgumentException
- if column index is out of range.public void setColumnHidden(int columnIndex, boolean isHidden)
columnIndex
- column index.isHidden
- true for hidden.
java.lang.IllegalArgumentException
- if the column index is out of range.
CellsException
- if the worksheet has been removed from the workbook.public NamedRange createNamedRange(java.lang.String name, java.lang.String startCellName, java.lang.String endCellName)
name
- the name of the range.startCellName
- start cell name of this cell range.endCellName
- end cell name of this cell range.
java.lang.IllegalArgumentException
- if cell name is invalid.
java.lang.IllegalArgumentException
- if name is invalid.public NamedRange createNamedRange(java.lang.String name, int startRow, int startColumn, int endRow, int endColumn)
name
- the name of the range.startRow
- row index of the top left cell.startColumn
- column index of the top left cell.endRow
- row index of the bottom right cell.endColumn
- column index of the bottom right cell.
java.lang.IllegalArgumentException
- if row or column index is out of range.
java.lang.IllegalArgumentException
- if name is invalid.public NamedRange createNamedRange(java.lang.String name, int startIndex, int number, boolean isVertical)
name
- the name of the range.startIndex
- start row index or start column index, zero based.number
- total number of rows or columns, one based.isVertical
- true - Range created from columns of cells. False - Range created from rows of cells.
java.lang.IllegalArgumentException
- if row or column index is out of range.
java.lang.IllegalArgumentException
- if name is invalid.public void subtotal(CellArea ca, int groupBy, short function, int[] totalList)
ca
- The range.groupBy
- The field to group by, as a zero-based integer offset.function
- The subtotal function, enumerated by ConsolidationFunction
.totalList
- An array of zero-based field offsets, indicating the fields to which the subtotals are added.public void subtotal(CellArea ca, int groupBy, short function, java.lang.String subTotalHeaderFormat, java.lang.String grandTotalHeader, int[] totalList)
ca
- The range.groupBy
- The field to group by, as a zero-based integer offset.function
- The subtotal function, enumerated by ConsolidationFunction
.subTotalHeaderFormat
- header format string for subtotal summary, such as "%1$s Total".
The header string for summary of subtotal will be got by String.format(subTotalHeaderFormat
, valOfGroupBy) where valOfGroupBy is the field value to group by.grandTotalHeader
- header string for grand total summary, such as "Grand Total".totalList
- An array of zero-based field offsets, indicating the fields to which the subtotals are added.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |