![]() |
||
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 | |
---|---|
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 |
deleteColumns(int startIndex,
int deletedColumns,
boolean bShift)
Removes columns from the worksheet. |
void |
deleteRows(int startIndex,
int deletedRows,
boolean bShift)
Removes rows from the worksheet. |
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"). |
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. |
int |
getMaxRow()
Returns the last defined row index. |
java.util.ArrayList |
getMergedCells()
Gets the collection of merged cell ranges in the worksheet. |
int |
getMinRow()
Returns the first defined row index. |
Row |
getRow(int rowIndex)
Gets the row at the specified row index. |
java.util.Iterator |
getRowIterator()
Returns an iterator which can iterate all defined rows in this worksheet. |
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. |
float |
getStandardWidth()
Returns the default column width of the worksheet, in unit of characters with default font. |
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. |
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,
int rowNum,
int columnNum,
boolean isFieldNameShown)
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 |
insertRows(int rowIndex,
int rowNum)
Inserts multiple rows into the worksheet. |
boolean |
isColumnHidden(int columnIndex)
Checks if the specified column is hidden. |
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 |
setRangeStyle(int startRow,
int endRow,
int startColumn,
int endColumn,
Style style)
Sets a style for an area of cells. |
void |
setStandardHeight(float defaultRowHeight)
Sets the default row height of the worksheet, in unit of points. |
void |
setStandardWidth(float defaultColumnWidth)
Sets the default column width of the worksheet, in unit of characters using default font. |
void |
ungroupColumns(int startIndex,
int endIndex)
Ungroups columns. |
void |
ungroupRows(int startIndex,
int endIndex)
Ungroups rows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Rows getRows()
ExcelException
- if the worksheet has been removed from the workbook.public Columns getColumns()
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- if the worksheet has been removed from the workbook.public void removeRow(int rowIndex)
rowIndex
- row index.
java.lang.IllegalArgumentException
- if row index is out of range.
ExcelException
- if the worksheet has been removed from the workbook.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 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.
ExcelException
- 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 ).
ExcelException
- if the worksheet has been removed from the workbook.public float getStandardHeight()
public void setStandardHeight(float defaultRowHeight)
defaultRowHeight
- row height in points(0-409).
java.lang.IllegalArgumentException
- if the row height is invalid.
ExcelException
- 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.
ExcelException
- if the worksheet has been removed from the workbook.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.
ExcelException
- if the worksheet has been removed from the workbook.public java.util.ArrayList getMergedCells()
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.
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- 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.
ExcelException
- if the worksheet has been removed from the workbook.public int getMinRow()
public int getMaxRow()
public java.util.Iterator getRowIterator()
ExcelException
- if the worksheet has been removed from the workbook.public float getColumnWidth(int columnIndex)
columnIndex
- column index.
java.lang.IllegalArgumentException
- if column index is out of range.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.
ExcelException
- if the worksheet has been removed from the workbook.public 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.
ExcelException
- 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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |