Namespace EasyXLS
Class ExcelTable
System.Object
EasyXLS.ExcelTable
public class ExcelTable
extends System.Object
This class simulates a worksheet table. It is assigned to an ExcelWorksheet class. It allows to access the spreadsheet cells, to add rows and columns, to set default row height and column width, to add horizontal and vertical page breaks for page break preview.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClone()
Creates and returns a copy of this object.int
Returns the number of columns from the table.void
Dispose()
Disposes any resources that it has allocated.void
Adds a column to table.void
easy_addColumn(ExcelColumn columnData)
Adds the specified column to table.
This method is overridden as easy_addColumn_2 in COM+ version of EasyXLS.
void
Adds a row to table.void
easy_addRow(ExcelRow rowData)
Adds the specified row to table.
This method is overridden as easy_addRow_2 in COM+ version of EasyXLS.
void
easy_freezePanes(int splitRow, int splitColumn)
Sets the freeze panes for the table.void
easy_freezePanes(int splitRow, int splitColumn, int topVisibleRow_BottomPane, int leftVisibleColumn_RightPane)
Sets the freeze panes for the table.
This method is overridden as easy_freezePanes_2 in COM+ version of EasyXLS.
easy_getCell(int row, int column)
If a cell does not exist at the specified position, it creates one, and returns the cell.easy_getCell(System.String cellReference)
Returns the cell at the specified reference.
This method is overridden as easy_getCell_2 in COM+ version of EasyXLS.
easy_getCellAt(int row, int column)
Returns the cell at the specified row and column.int
easy_getCellMergingFirstCol(int nIndex)
Returns the first column of the specified cell merging range.int
easy_getCellMergingFirstRow(int nIndex)
Returns the first row of the specified cell merging range.int
easy_getCellMergingLastCol(int nIndex)
Returns the last column of the specified cell merging range.int
easy_getCellMergingLastRow(int nIndex)
Returns the last row of the specified cell merging range.easy_getColumnAt(int column)
Returns the column at the specified position.System.String
easy_getMergingRangeAsA1Reference(int nIndex)
Internal use only Returns the cell merging range at the specified range as A1 reference (e.g.easy_getRowAt(int row)
Returns the row at specified position.void
easy_insertColumn(int column, ExcelColumn columnData)
Inserts the specified column to table into the specified position.void
easy_insertPageBreakAtColumn(int column)
Inserts a page break after the specified column.void
easy_insertPageBreakAtRow(int row)
Inserts a page break after the specified row.void
easy_insertRow(int row, ExcelRow rowData)
Inserts the specified row to table into the specified position.void
easy_mergeCells(int startRow, int startColumn, int endRow, int endColumn)
Merging the cells inside the specified range.void
easy_mergeCells(System.String range)
Merging the cells inside the specified range.
This method is overridden as easy_mergeCells_2 in COM+ version of EasyXLS.
void
easy_mergeCells(System.String startCellReference, System.String endCellReference)
Merging the cells inside the range limited by the specified cell references.
This method is overridden as easy_mergeCells_3 in COM+ version of EasyXLS.
void
easy_removeCellMerging(int nIndex)
Removes the cell merging area at the specified index from the tablevoid
easy_removeColumn(int column)
Removes the column at the specified index from the tablevoid
easy_removeColumnRange(int startColumn, int count)
Removes a range of columns from the tablevoid
easy_removeRow(int row)
Removes the row at the specified index from the tablevoid
easy_removeRowRange(int startRow, int count)
Removes a range of rows from the tablevoid
Removes the split option for the table.void
Resets all the defined page breaks.void
easy_setCellAt(ExcelCell cell, int row, int column)
Sets the cell at the specified position.void
easy_setRangeAutoFormat(int startRow, int startColumn, int endRow, int endColumn, ExcelAutoFormat xlsAutoFormat)
Sets the specified autoformat for the range.void
easy_setRangeAutoFormat(System.String range, ExcelAutoFormat xlsAutoFormat)
Sets the specified autoformat for the range.
This method is overridden as easy_setRangeAutoFormat_2 in COM+ version of EasyXLS.
void
easy_setRangeAutoFormat(System.String startCellReference, System.String endCellReference, ExcelAutoFormat xlsAutoFormat)
Sets the specified autoformat for the range limited by the specified cell references.
This method is overridden as easy_setRangeAutoFormat_3 in COM+ version of EasyXLS.
void
easy_setRangeStyle(int startRow, int startColumn, int endRow, int endColumn, ExcelStyle style)
Sets the specified style for the range limited by the rows and columns.void
easy_setRangeStyle(System.String range, ExcelStyle style)
Sets the specified style for the range.
This method is overridden as easy_setRangeStyle_2 in COM+ version of EasyXLS.
void
easy_setRangeStyle(System.String startCellReference, System.String endCellReference, ExcelStyle style)
Sets the specified style for the range limited by the specified cell references.
This method is overridden as easy_setRangeStyle_3 in COM+ version of EasyXLS.
void
easy_split(int splitRow, int splitColumn)
Sets the split option for the table.void
easy_split(int splitRow, int splitColumn, int topVisibleRow_BottomPane, int leftVisibleColumn_RightPane)
Sets the split option for the table.
This method is overridden as easy_split_2 in COM+ version of EasyXLS.
void
Unfreezes panes for the table.findAll(System.String value, int lookIn, bool matchCase, bool matchEntireCellContents)
Searches all the occurrences of the cell that matches the criteria.findFirst(System.String value, int lookIn, bool matchCase, bool matchEntireCellContents)
Searches the first cell that matches the criteria.int
Returns the default width of the columns.int
getColumnWidth(int column)
Returns the width of the specified column.
This method is overridden as getColumnWidth_2 in COM+ version of EasyXLS.
Returns a list with all horizontal page breaksint
Returns the default height of the rows.int
getRowHeight(int row)
Returns the height of the specified row.
This method is overridden as getRowHeight_2 in COM+ version of EasyXLS.
Returns a list with all vertical page breaksbool
Returns true if the row/columns are frozen, false otherwise.bool
Returns true if the default row height was set, false otherwise.bool
Returns true if the row/columns are split, false otherwise.int
Returns the count of the cell merging ranges.int
RowCount()
Returns the number of rows from the table.void
setColumnCount(int count)
Sets the number of columns for the table.void
setColumnWidth(int width)
Sets the default width of the columns.void
setColumnWidth(int column, int columnWidth)
Sets the width for the specified column.
This method is overridden as setColumnWidth_2 in COM+ version of EasyXLS.
void
setFreezePaneSet(bool isFreezePaneSet)
Internal use onlyvoid
setRowCount(int count)
Sets the number of rows for the table.void
setRowHeight(int height)
Sets the default height of the rows.void
setRowHeight(int row, int rowHeight)
Sets the height for the specified row.
This method is overridden as setRowHeight_2 in COM+ version of EasyXLS.
void
setRowHeightSet(bool isRowHeightSet)
Internal use onlyvoid
setSplitSet(bool isSplitSet)
Internal use onlyvoid
validate()
Finalize the changes applied on the rows, columns and cells.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelTable
public ExcelTable()Defines an instance of the worksheet table.
-
-
Method Details
-
validate
public void validate()Finalize the changes applied on the rows, columns and cells. -
RowCount
public int RowCount()Returns the number of rows from the table.- Returns:
- the number of rows from the table
- See Also:
setRowCount(int)
-
setRowCount
public void setRowCount(int count)Sets the number of rows for the table.- Parameters:
count
- the number of rows from the table- See Also:
RowCount()
-
easy_addRow
public void easy_addRow()Adds a row to table. -
easy_addRow
Adds the specified row to table.
This method is overridden as easy_addRow_2 in COM+ version of EasyXLS.
- Parameters:
rowData
- the row to be added- See Also:
easy_insertRow(int, EasyXLS.ExcelRow)
,easy_removeRow(int)
-
easy_insertRow
Inserts the specified row to table into the specified position.- Parameters:
row
- the position where the row will be insertedrowData
- the row to be inserted- See Also:
easy_addRow()
,easy_removeRow(int)
-
easy_removeRow
public void easy_removeRow(int row)Removes the row at the specified index from the table- Parameters:
row
- the row index- See Also:
easy_addRow()
,easy_insertRow(int, EasyXLS.ExcelRow)
,easy_removeRowRange(int, int)
-
easy_removeRowRange
public void easy_removeRowRange(int startRow, int count)Removes a range of rows from the table- Parameters:
startRow
- the starting index of the rowscount
- the number of rows to be removed- See Also:
easy_addRow()
,easy_insertRow(int, EasyXLS.ExcelRow)
,easy_removeRow(int)
-
getRowHeight
public int getRowHeight()Returns the default height of the rows.- Returns:
- the default height of the rows
- See Also:
setRowHeight(int)
,getRowHeight(int)
,setRowHeight(int,int)
-
setRowHeight
public void setRowHeight(int height)Sets the default height of the rows.- Parameters:
height
- the default height of the rows- See Also:
getRowHeight()
,getRowHeight(int)
,setRowHeight(int,int)
-
IsRowHeightSet
public bool IsRowHeightSet()Returns true if the default row height was set, false otherwise.- Returns:
- true if the default row height was set, false otherwise
- See Also:
setRowHeight(int)
-
setRowHeightSet
public void setRowHeightSet(bool isRowHeightSet)Internal use only- Parameters:
isRowHeightSet
- true if the default row height is set, false otherwise
-
getRowHeight
public int getRowHeight(int row)Returns the height of the specified row.
This method is overridden as getRowHeight_2 in COM+ version of EasyXLS.
- Parameters:
row
- the index of the row for which to return the height- Returns:
- the height of the specified row
- See Also:
getRowHeight()
,setRowHeight(int)
,setRowHeight(int,int)
-
setRowHeight
public void setRowHeight(int row, int rowHeight)Sets the height for the specified row.
This method is overridden as setRowHeight_2 in COM+ version of EasyXLS.
- Parameters:
row
- the index of the rowrowHeight
- the new value of the height- See Also:
getRowHeight()
,setRowHeight(int)
,getRowHeight(int)
-
easy_getRowAt
Returns the row at specified position.- Parameters:
row
- the row position- Returns:
- the row at specified position
-
ColumnCount
public int ColumnCount()Returns the number of columns from the table.- Returns:
- the number of columns from the table
- See Also:
setColumnCount(int)
-
setColumnCount
public void setColumnCount(int count)Sets the number of columns for the table.- Parameters:
count
- the number of columns for the table- See Also:
ColumnCount()
-
easy_addColumn
public void easy_addColumn()Adds a column to table. -
easy_addColumn
Adds the specified column to table.
This method is overridden as easy_addColumn_2 in COM+ version of EasyXLS.
- Parameters:
columnData
- the column to be added- See Also:
easy_insertColumn(int, EasyXLS.ExcelColumn)
,easy_removeColumn(int)
-
easy_insertColumn
Inserts the specified column to table into the specified position.- Parameters:
column
- the position where the column will be insertedcolumnData
- the column to be inserted- See Also:
easy_addColumn()
,easy_removeColumn(int)
-
easy_removeColumn
public void easy_removeColumn(int column)Removes the column at the specified index from the table- Parameters:
column
- the column index- See Also:
easy_addColumn()
,easy_insertColumn(int, EasyXLS.ExcelColumn)
,easy_removeColumnRange(int, int)
-
easy_removeColumnRange
public void easy_removeColumnRange(int startColumn, int count)Removes a range of columns from the table- Parameters:
startColumn
- the starting index of the columnscount
- the number of columns to be removed- See Also:
easy_addColumn()
,easy_insertColumn(int, EasyXLS.ExcelColumn)
,easy_removeColumn(int)
-
getColumnWidth
public int getColumnWidth()Returns the default width of the columns.- Returns:
- the default width of the columns
- See Also:
setColumnWidth(int)
,getColumnWidth(int)
,setColumnWidth(int,int)
-
setColumnWidth
public void setColumnWidth(int width)Sets the default width of the columns.- Parameters:
width
- the new default width of the columns- See Also:
getColumnWidth()
,getColumnWidth(int)
,setColumnWidth(int,int)
-
getColumnWidth
public int getColumnWidth(int column)Returns the width of the specified column.
This method is overridden as getColumnWidth_2 in COM+ version of EasyXLS.
- Parameters:
column
- the column index for which to return the width- Returns:
- the width of the specified column
- See Also:
getColumnWidth()
,setColumnWidth(int)
,setColumnWidth(int,int)
-
setColumnWidth
public void setColumnWidth(int column, int columnWidth)Sets the width for the specified column.
This method is overridden as setColumnWidth_2 in COM+ version of EasyXLS.
- Parameters:
column
- the column positioncolumnWidth
- the new width of the column- See Also:
getColumnWidth()
,setColumnWidth(int)
,getColumnWidth(int)
-
easy_getColumnAt
Returns the column at the specified position.- Parameters:
column
- the column position- Returns:
- the column at specified position
-
easy_getCellAt
Returns the cell at the specified row and column. If the cell does not exist an 'array index out of range exception' will be thrown.- Parameters:
row
- the row that specifies the cell positioncolumn
- the column that specifies the cell position- Returns:
- the cell at specified position
- See Also:
easy_getCell(int, int)
,easy_setCellAt(EasyXLS.ExcelCell, int, int)
-
easy_getCell
If a cell does not exist at the specified position, it creates one, and returns the cell. Note: Slower than easy_getCellAt method.- Parameters:
row
- the row that specifies the cell positioncolumn
- the column that specifies the cell position- Returns:
- the cell at specified position
- See Also:
easy_getCellAt(int, int)
,easy_setCellAt(EasyXLS.ExcelCell, int, int)
-
easy_getCell
Returns the cell at the specified reference.
This method is overridden as easy_getCell_2 in COM+ version of EasyXLS.
- Parameters:
cellReference
- the cell reference that specifies the cell position- Returns:
- the cell at specified position
- See Also:
easy_getCell(int, int)
,easy_setCellAt(EasyXLS.ExcelCell, int, int)
-
easy_setCellAt
Sets the cell at the specified position.- Parameters:
cell
- the cell to be setrow
- the row positioncolumn
- the column position- See Also:
easy_getCellAt(int, int)
,easy_getCell(int, int)
-
easy_setRangeAutoFormat
public void easy_setRangeAutoFormat(int startRow, int startColumn, int endRow, int endColumn, ExcelAutoFormat xlsAutoFormat)Sets the specified autoformat for the range.- Parameters:
startRow
- the row that limits the left upper corner of the cell rangestartColumn
- the column that limits the left upper corner of the cell rangeendRow
- the row that limits the right down corner of the cell rangeendColumn
- the column that limits the right down corner of the cell rangexlsAutoFormat
- the autoformat to be applied
-
easy_setRangeAutoFormat
Sets the specified autoformat for the range.
This method is overridden as easy_setRangeAutoFormat_2 in COM+ version of EasyXLS.
- Parameters:
range
- the range where the autoformat will be applied. It can be a cell reference or a range.xlsAutoFormat
- the autoformat to be applied
-
easy_setRangeAutoFormat
public void easy_setRangeAutoFormat(System.String startCellReference, System.String endCellReference, ExcelAutoFormat xlsAutoFormat)Sets the specified autoformat for the range limited by the specified cell references.
This method is overridden as easy_setRangeAutoFormat_3 in COM+ version of EasyXLS.
- Parameters:
startCellReference
- the cell reference that limits the left upper corner of the cell rangeendCellReference
- the cell reference that limits the right down corner of the cell rangexlsAutoFormat
- the autoformat to be applied
-
easy_setRangeStyle
public void easy_setRangeStyle(int startRow, int startColumn, int endRow, int endColumn, ExcelStyle style)Sets the specified style for the range limited by the rows and columns.- Parameters:
startRow
- the row that limits the left upper corner of the cell rangestartColumn
- the column that limits the left upper corner of the cell rangeendRow
- the row that limits the right down corner of the cell rangeendColumn
- the column that limits the right down corner of the cell rangestyle
- the style for the cells
-
easy_setRangeStyle
Sets the specified style for the range.
This method is overridden as easy_setRangeStyle_2 in COM+ version of EasyXLS.
- Parameters:
range
- the range where the style will be applied. It can be a cell reference or a range.style
- the style for the cells
-
easy_setRangeStyle
public void easy_setRangeStyle(System.String startCellReference, System.String endCellReference, ExcelStyle style)Sets the specified style for the range limited by the specified cell references.
This method is overridden as easy_setRangeStyle_3 in COM+ version of EasyXLS.
- Parameters:
startCellReference
- the cell reference that limits the left upper corner of the cell rangeendCellReference
- the cell reference that limits the right down corner of the cell rangestyle
- the style for the cells
-
easy_mergeCells
public void easy_mergeCells(int startRow, int startColumn, int endRow, int endColumn)Merging the cells inside the specified range.- Parameters:
startRow
- the row that limits the left upper corner of the cell rangestartColumn
- the column that limits the left upper corner of the cell rangeendRow
- the row that limits the right down corner of the cell rangeendColumn
- the column that limits the right down corner of the cell range
-
easy_mergeCells
public void easy_mergeCells(System.String range)Merging the cells inside the specified range.
This method is overridden as easy_mergeCells_2 in COM+ version of EasyXLS.
- Parameters:
range
- the cell range- See Also:
easy_mergeCells(int,int,int,int)
,easy_mergeCells(String,String)
-
easy_mergeCells
public void easy_mergeCells(System.String startCellReference, System.String endCellReference)Merging the cells inside the range limited by the specified cell references.
This method is overridden as easy_mergeCells_3 in COM+ version of EasyXLS.
- Parameters:
startCellReference
- the cell reference that limits the left upper corner of the cell rangeendCellReference
- the cell reference that limits the right down corner of the cell range- See Also:
easy_mergeCells(int,int,int,int)
,easy_mergeCells(String)
-
easy_getMergingRangeAsA1Reference
public System.String easy_getMergingRangeAsA1Reference(int nIndex)Internal use only Returns the cell merging range at the specified range as A1 reference (e.g. B2:G9).- Parameters:
nIndex
- the merge cells range index- Returns:
- cell merging range at the specified range as A1 reference (e.g. B2:G9)
-
easy_getCellMergingFirstRow
public int easy_getCellMergingFirstRow(int nIndex)Returns the first row of the specified cell merging range.- Parameters:
nIndex
- the merge cells range index- Returns:
- the first row of the specified cell merging range
- See Also:
easy_getCellMergingLastRow(int)
,easy_getCellMergingFirstCol(int)
,easy_getCellMergingLastCol(int)
-
easy_getCellMergingLastRow
public int easy_getCellMergingLastRow(int nIndex)Returns the last row of the specified cell merging range.- Parameters:
nIndex
- the merge cells range index- Returns:
- the last row of the specified cell merging range
- See Also:
easy_getCellMergingFirstRow(int)
,easy_getCellMergingFirstCol(int)
,easy_getCellMergingLastCol(int)
-
easy_getCellMergingFirstCol
public int easy_getCellMergingFirstCol(int nIndex)Returns the first column of the specified cell merging range.- Parameters:
nIndex
- the merge cells range index- Returns:
- the first column of the specified cell merging range
- See Also:
easy_getCellMergingFirstRow(int)
,easy_getCellMergingLastRow(int)
,easy_getCellMergingLastCol(int)
-
easy_getCellMergingLastCol
public int easy_getCellMergingLastCol(int nIndex)Returns the last column of the specified cell merging range.- Parameters:
nIndex
- the merge cells range index- Returns:
- the last column of the specified cell merging range
- See Also:
easy_getCellMergingFirstRow(int)
,easy_getCellMergingLastRow(int)
,easy_getCellMergingFirstCol(int)
-
MergeCellRangesCount
public int MergeCellRangesCount()Returns the count of the cell merging ranges.- Returns:
- the count of the cell merging ranges
-
easy_removeCellMerging
public void easy_removeCellMerging(int nIndex)Removes the cell merging area at the specified index from the table- Parameters:
nIndex
- the cell merging area index
-
easy_insertPageBreakAtRow
public void easy_insertPageBreakAtRow(int row)Inserts a page break after the specified row.- Parameters:
row
- the row after which the page break will be inserted- See Also:
easy_insertPageBreakAtColumn(int)
,easy_resetAllPageBreaks()
-
easy_insertPageBreakAtColumn
public void easy_insertPageBreakAtColumn(int column)Inserts a page break after the specified column.- Parameters:
column
- the column after which the page break will be inserted- See Also:
easy_insertPageBreakAtRow(int)
,easy_resetAllPageBreaks()
-
easy_resetAllPageBreaks
public void easy_resetAllPageBreaks()Resets all the defined page breaks. -
getHorizontalPageBreaks
Returns a list with all horizontal page breaks- Returns:
- a list with all horizontal page breaks
- See Also:
getVerticalPageBreaks()
-
getVerticalPageBreaks
Returns a list with all vertical page breaks- Returns:
- a list with all vertical page breaks
- See Also:
getHorizontalPageBreaks()
-
easy_freezePanes
public void easy_freezePanes(int splitRow, int splitColumn)Sets the freeze panes for the table.- Parameters:
splitRow
- the row position of the splitsplitColumn
- the column position of the split- See Also:
easy_freezePanes(int,int,int,int)
,easy_unfreezePanes()
-
easy_freezePanes
public void easy_freezePanes(int splitRow, int splitColumn, int topVisibleRow_BottomPane, int leftVisibleColumn_RightPane)Sets the freeze panes for the table.
This method is overridden as easy_freezePanes_2 in COM+ version of EasyXLS.
- Parameters:
splitRow
- the row position of the splitsplitColumn
- the column position of the splittopVisibleRow_BottomPane
- the top row visible in the bottom paneleftVisibleColumn_RightPane
- the left most column visible in the right pane- See Also:
easy_freezePanes(int,int)
,easy_unfreezePanes()
-
easy_split
public void easy_split(int splitRow, int splitColumn)Sets the split option for the table.- Parameters:
splitRow
- the row position of the splitsplitColumn
- the column position of the split- See Also:
easy_split(int,int,int,int)
,easy_removeSplit()
-
easy_split
public void easy_split(int splitRow, int splitColumn, int topVisibleRow_BottomPane, int leftVisibleColumn_RightPane)Sets the split option for the table.
This method is overridden as easy_split_2 in COM+ version of EasyXLS.
- Parameters:
splitRow
- the row position of the splitsplitColumn
- the column position of the splittopVisibleRow_BottomPane
- the top row visible in the bottom paneleftVisibleColumn_RightPane
- the left most visible column in the right pane- See Also:
easy_split(int,int)
,easy_removeSplit()
-
easy_unfreezePanes
public void easy_unfreezePanes()Unfreezes panes for the table. -
easy_removeSplit
public void easy_removeSplit()Removes the split option for the table.- See Also:
easy_split(int,int)
,easy_split(int,int,int,int)
-
IsFreezePaneSet
public bool IsFreezePaneSet()Returns true if the row/columns are frozen, false otherwise.- Returns:
- true if the row/columns are frozen, false otherwise.
- See Also:
easy_freezePanes(int,int)
-
setFreezePaneSet
public void setFreezePaneSet(bool isFreezePaneSet)Internal use only- Parameters:
isFreezePaneSet
- true if the freeze is active, false otherwise
-
IsSplitSet
public bool IsSplitSet()Returns true if the row/columns are split, false otherwise.- Returns:
- true if the row/columns are split, false otherwise.
- See Also:
easy_split(int,int,int,int)
-
setSplitSet
public void setSplitSet(bool isSplitSet)Internal use only- Parameters:
isSplitSet
- true if the split is active, false otherwise
-
findFirst
public Cell findFirst(System.String value, int lookIn, bool matchCase, bool matchEntireCellContents)Searches the first cell that matches the criteria.- Parameters:
value
- the string to be searchedlookIn
- shows whether the search is in formulas, in values or in comments. Possible values are available inTable
class.matchCase
- true if the search is case sensitive, false otherwisematchEntireCellContents
- true if the search matches the entire cell contents, false otherwise- Returns:
- the first cell that matches the criteria
- See Also:
findAll(System.String, int, bool, bool)
-
findAll
Searches all the occurrences of the cell that matches the criteria.- Parameters:
value
- the string to be searchedlookIn
- shows whether the search is in formulas, in values or in comments. Possible values are available inTable
class.matchCase
- true if the search is case sensitive, false otherwisematchEntireCellContents
- true if the search matches the entire cell contents, false otherwise- Returns:
- all the occurrences of the cell that matches the criteria
- See Also:
findFirst(System.String, int, bool, bool)
-
Dispose
public void Dispose()Disposes any resources that it has allocated. -
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-