Cells

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class Cells implements Iterable

Encapsulates a collection of cell relevant objects, such as Cell, Row, …etc.

Remarks

Example

         Workbook excel = new Workbook();
         	Cells cells = excel.getWorksheets().get(0).getCells();
 
         	//Set default row height
         	cells.setStandardHeight(20);
         	//Set row height
         	cells.setRowHeight(2, 20.5);
 
         	//Set default colum width
         	cells.setStandardWidth(15);
         	//Set column width
         	cells.setColumnWidth(3, 12.57);
 
         	//Merge cells
         	cells.merge(5, 4, 2, 2);
 
         	//Put values to cells
         	cells.get(0, 0).putValue(true);
         	cells.get(0, 1).putValue(1);
         	cells.get(0, 2).putValue("abc");
 
         //Export data
         Object[][] arr = cells.exportArray(0, 0, 10, 10);

Methods

MethodDescription
addRange(Range rangeObject)Adds a range object reference to cells
applyColumnStyle(int column, Style style, StyleFlag flag)Applies formats for a whole column.
applyRowStyle(int row, Style style, StyleFlag flag)Applies formats for a whole row.
applyStyle(Style style, StyleFlag flag)Applies formats for a whole worksheet.
checkCell(int row, int column)Gets the Cell element or null at the specified cell row index and column index.
checkColumn(int columnIndex)Gets the Column element or null at the specified column index.
checkRow(int row)Gets the Row element or null at the specified cell row index.
clear()Clears all data of the worksheet.
clearContents(CellArea range)Clears contents of a range.
clearContents(int startRow, int startColumn, int endRow, int endColumn)Clears contents of a range.
clearFormats(CellArea range)Clears formatting of a range.
clearFormats(int startRow, int startColumn, int endRow, int endColumn)Clears formatting of a range.
clearMergedCells()Clears all merged ranges.
clearRange(CellArea range)Clears contents and formatting of a range.
clearRange(int startRow, int startColumn, int endRow, int endColumn)Clears contents and formatting of a range.
convertStringToNumericValue()Converts all string data in the worksheet to numeric value if possible.
copyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex)Copies data and formats of a whole column.
copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber)Copies data and formats of a whole column.
copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber, PasteOptions pasteOptions)Copies data and formats of a whole column.
copyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns)Copies data and formats of the whole columns.
copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)Copies data and formats of a whole row.
copyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber)Copies data and formats of some whole rows.
copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions)Copies data and formats of some whole rows.
copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions, PasteOptions pasteOptions)Copies data and formats of some whole rows.
createRange(int firstIndex, int number, boolean isVertical)Creates a Range object from rows of cells or columns of cells.
createRange(int firstRow, int firstColumn, int totalRows, int totalColumns)Creates a Range object from a range of cells.
createRange(String address)Creates a Range object from an address of the range.
createRange(String upperLeftCell, String lowerRightCell)Creates a Range object from a range of cells.
deleteBlankColumns()Delete all blank columns which do not contain any data.
deleteBlankColumns(DeleteOptions options)Delete all blank columns which do not contain any data.
deleteBlankRows()Delete all blank rows which do not contain any data or other object.
deleteBlankRows(DeleteOptions options)Delete all blank rows which do not contain any data or other object.
deleteColumn(int columnIndex)Deletes a column.
deleteColumn(int columnIndex, boolean updateReference)Deletes a column.
deleteColumns(int columnIndex, int totalColumns, boolean updateReference)Deletes several columns.
deleteRange(int startRow, int startColumn, int endRow, int endColumn, int shiftType)Deletes a range of cells and shift cells according to the shift option.
deleteRow(int rowIndex)Deletes a row.
deleteRow(int rowIndex, boolean updateReference)Deletes a row.
deleteRows(int rowIndex, int totalRows)Deletes several rows.
deleteRows(int rowIndex, int totalRows, boolean updateReference)Deletes multiple rows in the worksheet.
dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
endCellInColumn(int startRow, int endRow, short startColumn, short endColumn)Gets the last cell with maximum column index in this range.
endCellInColumn(short columnIndex)Gets the last cell in this column.
endCellInRow(int rowIndex)Gets the last cell in this row.
endCellInRow(int startRow, int endRow, int startColumn, int endColumn)Gets the last cell with maximum row index in this range.
equals(Object arg0)
exportArray(int firstRow, int firstColumn, int totalRows, int totalColumns)Exports data in the Cells collection to a two-dimension array object.
exportTypeArray(int firstRow, int firstColumn, int totalRows, int totalColumns)Exports cell value type in the Cells collection to a two-dimension array object.
find(Object what, Cell previousCell)Finds the cell containing with the input object.
find(Object what, Cell previousCell, FindOptions findOptions)Finds the cell containing with the input object.
get(int row, int column)Gets the Cell element at the specified cell row index and column index.
get(String cellName)Gets the Cell element at the specified cell name.
getCellStyle(int row, int column)Get the style of given cell.
getClass()
getColumnOriginalWidthPoint(int column)Gets original column’s height in unit of point if the column is hidden
getColumnWidth(int column)Gets the width(in unit of characters) of the specified column in normal view
getColumnWidth(int column, boolean isOriginal, int unitType)Gets the column width.
getColumnWidthInch(int column)Gets the width of the specified column in normal view, in units of inches.
getColumnWidthPixel(int column)Gets the width of the specified column in normal view, in units of pixel.
getColumnWidthPixel(int column, boolean original)Gets the width of the specified column in normal view, in units of pixel.
getColumns()Gets the collection of Column objects that represents the individual columns in this worksheet.
getCount()Gets the total count of instantiated Cell objects.
getCountLarge()Gets the total count of instantiated Cell objects.
getDependents(boolean isAll, int row, int column)Get all cells which refer to the specific cell.
getDependentsInCalculation(int row, int column, boolean recursive)Gets all cells whose calculated result depends on specific cell.
getFirstCell()Gets the first cell in this worksheet.
getGroupedColumnOutlineLevel(int columnIndex)Gets the outline level (zero-based) of the column.
getGroupedRowOutlineLevel(int rowIndex)Gets the outline level (zero-based) of the row.
getLastCell()Gets the last cell in this worksheet.
getLastDataRow(int column)Gets the last row index of cell which contains data in the specified column.
getMaxColumn()Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
getMaxDataColumn()Maximum column index of cell which contains data.
getMaxDataRow()Maximum row index of cell which contains data.
getMaxDisplayRange()Gets the max range which includes data, merged cells and shapes.
getMaxGroupedColumnOutlineLevel()Gets the max grouped column outline level (zero-based).
getMaxGroupedRowOutlineLevel()Gets the max grouped row outline level (zero-based).
getMaxRow()Maximum row index of cell which contains data or style.
getMemorySetting()Gets the memory usage option for this cells.
getMergedAreas()Gets all merged cells.
getMergedCells()Gets the collection of merged cells.
getMinColumn()Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
getMinDataColumn()Minimum column index of cell which contains data.
getMinDataRow()Minimum row index of cell which contains data.
getMinRow()Minimum row index of cell which contains data or style.
getMultiThreadReading()Gets whether the cells data model should support Multi-Thread reading.
getOdsCellFields()Gets the list of fields of ods.
getPreserveString()Gets a value indicating whether all worksheet values are preserved as strings.
getRanges()Gets the collection of Range objects created at run time.
getRowEnumerator()Gets the rows enumerator.
getRowHeight(int row)Gets the height of a specified row, in unit of points.
getRowHeight(int row, boolean isOriginal, int unitType)Gets row’s height.
getRowHeightInch(int row)Gets the height of a specified row in unit of inches.
getRowHeightPixel(int row)Gets the height of a specified row in unit of pixel.
getRowOriginalHeightPoint(int row)Gets original row’s height in unit of point if the row is hidden
getRows()Gets the collection of Row objects that represents the individual rows in this worksheet.
getStandardHeight()Gets the default row height in this worksheet, in unit of points.
getStandardHeightInch()Gets the default row height in this worksheet, in unit of inches.
getStandardHeightPixels()Gets the default row height in this worksheet, in unit of pixels.
getStandardWidth()Gets the default column width in the worksheet, in unit of characters.
getStandardWidthInch()Gets the default column width in the worksheet, in unit of inches.
getStandardWidthPixels()Gets the default column width in the worksheet, in unit of pixels.
getStyle()Gets the default style of the worksheet.
getViewColumnWidthPixel(int column)Get the width in different view type.
getViewRowHeight(int row)Gets the height of a specified row.
getViewRowHeightInch(int row)Gets the height of a specified row in unit of inches.
groupColumns(int firstIndex, int lastIndex)Groups columns.
groupColumns(int firstIndex, int lastIndex, boolean isHidden)Groups columns.
groupRows(int firstIndex, int lastIndex)Groups rows.
groupRows(int firstIndex, int lastIndex, boolean isHidden)Groups rows.
hashCode()
hideColumn(int column)Hides a column.
hideColumns(int column, int totalColumns)Hide multiple columns.
hideGroupDetail(boolean isVertical, int index)Collapses the grouped rows/columns.
hideRow(int row)Hides a row.
hideRows(int row, int totalRows)Hides multiple rows.
importArray(double[] doubleArray, int firstRow, int firstColumn, boolean isVertical)Imports an array of double into a worksheet.
importArray(double[][] doubleArray, int firstRow, int firstColumn)Imports a two-dimension array of double into a worksheet.
importArray(int[] intArray, int firstRow, int firstColumn, boolean isVertical)Imports an array of integer into a worksheet.
importArray(int[][] intArray, int firstRow, int firstColumn)Imports a two-dimension array of integer into a worksheet.
importArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)Imports an array of string into a worksheet.
importArray(String[][] stringArray, int firstRow, int firstColumn)Imports a two-dimension array of string into a worksheet.
importArrayList(ArrayList arrayList, int firstRow, int firstColumn, boolean isVertical)Imports an arraylist of data into a worksheet.
importCSV(InputStream stream, TxtLoadOptions options, int firstRow, int firstColumn)Import a CSV file to the cells.
importCSV(InputStream stream, String splitter, boolean convertNumericData, int firstRow, int firstColumn)Import a CSV file to the cells.
importCSV(String fileName, TxtLoadOptions options, int firstRow, int firstColumn)Import a CSV file to the cells.
importCSV(String fileName, String splitter, boolean convertNumericData, int firstRow, int firstColumn)Import a CSV file to the cells.
importCustomObjects(Collection list, int firstRow, int firstColumn, ImportTableOptions options)Imports custom objects.
importCustomObjects(Collection list, String[] propertyNames, boolean isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, boolean insertRows, String dateFormatString, boolean convertStringToNumber)Imports custom objects.
importData(ICellsDataTable table, int firstRow, int firstColumn, ImportTableOptions options)Import data from custom data table.
importFormulaArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)Imports an array of formula into a worksheet.
importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical)Imports an array of data into a worksheet.
importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical, int skip)Imports an array of data into a worksheet.
importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, int rowIndex, int columnIndex, ImportTableOptions options)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, String startCell, boolean isFieldNameShown)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, String startCell, ImportTableOptions options)Imports data in a ResultSet object to the worksheet.
importResultSet(ResultSet rs, String startCell, int rowNum, int columnNum, boolean isFieldNameShown)Imports data in a ResultSet object to the worksheet.
importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn)Imports a two-dimension array of data into a worksheet.
importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn, boolean convertStringToNumber)Imports a two-dimension array of data into a worksheet.
importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, boolean convertStringToNumber)Imports a two-dimension array of data into a worksheet.
importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, TxtLoadOptions opts)Imports a two-dimension array of data into a worksheet.
insertColumn(int columnIndex)Inserts a new column into the worksheet.
insertColumn(int columnIndex, boolean updateReference)Inserts a new column into the worksheet.
insertColumns(int columnIndex, int totalColumns)Inserts some columns into the worksheet.
insertColumns(int columnIndex, int totalColumns, boolean updateReference)Inserts some columns into the worksheet.
insertCutCells(Range cutRange, int row, int column, int shiftType)Insert cut range.
insertRange(CellArea area, int shiftType)Inserts a range of cells and shift cells according to the shift option.
insertRange(CellArea area, int shiftNumber, int shiftType)Inserts a range of cells and shift cells according to the shift option.
insertRange(CellArea area, int shiftNumber, int shiftType, boolean updateReference)Inserts a range of cells and shift cells according to the shift option.
insertRow(int rowIndex)Inserts a new row into the worksheet.
insertRows(int rowIndex, int totalRows)Inserts multiple rows into the worksheet.
insertRows(int rowIndex, int totalRows, boolean updateReference)Inserts multiple rows into the worksheet.
insertRows(int rowIndex, int totalRows, InsertOptions options)Inserts multiple rows into the worksheet.
isBlankColumn(int columnIndex)Checks whether given column is blank(does not contain any data).
isColumnHidden(int columnIndex)Checks whether a column at given index is hidden.
isDefaultRowHeightMatched()Indicates that row height and default font height matches
isDefaultRowHidden()Indicates whether the row is default hidden.
isDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns)Check whether the range could be deleted.
isRowHidden(int rowIndex)Checks whether a row at given index is hidden.
iterator()Gets the cells enumerator.
linkToXmlMap(String mapName, int row, int column, String path)Link to a xml map.
merge(int firstRow, int firstColumn, int totalRows, int totalColumns)Merges a specified range of cells into a single cell.
merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean mergeConflict)Merges a specified range of cells into a single cell.
merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean checkConflict, boolean mergeConflict)Merges a specified range of cells into a single cell.
moveRange(CellArea sourceArea, int destRow, int destColumn)Moves the range.
notify()
notifyAll()
removeDuplicates()Removes duplicate rows in the sheet.
removeDuplicates(int startRow, int startColumn, int endRow, int endColumn)Removes duplicate values in the range.
removeDuplicates(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders, int[] columnOffsets)Removes duplicate data of the range.
removeFormulas()Removes all formula and replaces with the value of the formula.
retrieveSubtotalSetting(CellArea ca)Retrieves subtotals setting of the range.
setColumnWidth(int column, double width)Sets the width of the specified column in normal view.
setColumnWidthInch(int column, double inches)Sets column width in unit of inches in normal view.
setColumnWidthPixel(int column, int pixels)Sets column width in unit of pixels in normal view.
setDefaultRowHeightMatched(boolean value)Indicates that row height and default font height matches
setDefaultRowHidden(boolean value)Indicates whether the row is default hidden.
setMemorySetting(int value)Sets the memory usage option for this cells.
setMultiThreadReading(boolean value)Sets whether the cells data model should support Multi-Thread reading.
setPreserveString(boolean value)Sets a value indicating whether all worksheet values are preserved as strings.
setRowHeight(int row, double height)Sets the height of the specified row.
setRowHeightInch(int row, double inches)Sets row height in unit of inches.
setRowHeightPixel(int row, int pixels)Sets row height in unit of pixels.
setStandardHeight(double value)Sets the default row height in this worksheet, in unit of points.
setStandardHeightInch(double value)Sets the default row height in this worksheet, in unit of inches.
setStandardHeightPixels(int value)Sets the default row height in this worksheet, in unit of pixels.
setStandardWidth(double value)Sets the default column width in the worksheet, in unit of characters.
setStandardWidthInch(double value)Sets the default column width in the worksheet, in unit of inches.
setStandardWidthPixels(int value)Sets the default column width in the worksheet, in unit of pixels.
setStyle(Style value)Sets the default style of the worksheet.
setViewColumnWidthPixel(int column, int pixels)Sets the width of the column in different view.
showGroupDetail(boolean isVertical, int index)Expands the grouped rows/columns.
subtotal(CellArea ca, int groupBy, int function, int[] totalList)Creates subtotals for the range.
subtotal(CellArea ca, int groupBy, int function, int[] totalList, boolean replace, boolean pageBreaks, boolean summaryBelowData)Creates subtotals for the range.
textToColumns(int row, int column, int totalRows, TxtLoadOptions options)Splits the text in the column to columns.
toString()
unMerge(int firstRow, int firstColumn, int totalRows, int totalColumns)Unmerges a specified range of merged cells.
ungroupColumns(int firstIndex, int lastIndex)Ungroups columns.
ungroupRows(int firstIndex, int lastIndex)Ungroups rows.
ungroupRows(int firstIndex, int lastIndex, boolean isAll)Ungroups rows.
unhideColumn(int column, double width)Unhides a column
unhideColumns(int column, int totalColumns, double width)Unhide multiple columns.
unhideRow(int row, double height)Unhides a row.
unhideRows(int row, int totalRows, double height)Unhides the hidden rows.
wait()
wait(long arg0)
wait(long arg0, int arg1)

addRange(Range rangeObject)

public void addRange(Range rangeObject)

Adds a range object reference to cells

Parameters:

ParameterTypeDescription
rangeObjectRangeThe range object will be contained in the cells

applyColumnStyle(int column, Style style, StyleFlag flag)

public void applyColumnStyle(int column, Style style, StyleFlag flag)

Applies formats for a whole column.

Parameters:

ParameterTypeDescription
columnintThe column index.
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

applyRowStyle(int row, Style style, StyleFlag flag)

public void applyRowStyle(int row, Style style, StyleFlag flag)

Applies formats for a whole row.

Parameters:

ParameterTypeDescription
rowintThe row index.
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

applyStyle(Style style, StyleFlag flag)

public void applyStyle(Style style, StyleFlag flag)

Applies formats for a whole worksheet.

Parameters:

ParameterTypeDescription
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

checkCell(int row, int column)

public Cell checkCell(int row, int column)

Gets the Cell element or null at the specified cell row index and column index.

Parameters:

ParameterTypeDescription
rowintRow index
columnintColumn index

Returns: Cell - Return Cell object if a Cell object exists. Return null if the cell does not exist.

checkColumn(int columnIndex)

public Column checkColumn(int columnIndex)

Gets the Column element or null at the specified column index.

Parameters:

ParameterTypeDescription
columnIndexintThe column index.

Returns: Column - The Column object.

checkRow(int row)

public Row checkRow(int row)

Gets the Row element or null at the specified cell row index.

Parameters:

ParameterTypeDescription
rowintRow index

Returns: Row - Returns Row object If the row object does exist, otherwise returns null.

clear()

public void clear()

Clears all data of the worksheet.

clearContents(CellArea range)

public void clearContents(CellArea range)

Clears contents of a range.

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearContents(int startRow, int startColumn, int endRow, int endColumn)

public void clearContents(int startRow, int startColumn, int endRow, int endColumn)

Clears contents of a range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

clearFormats(CellArea range)

public void clearFormats(CellArea range)

Clears formatting of a range.

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearFormats(int startRow, int startColumn, int endRow, int endColumn)

public void clearFormats(int startRow, int startColumn, int endRow, int endColumn)

Clears formatting of a range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

clearMergedCells()

public void clearMergedCells()

Clears all merged ranges.

clearRange(CellArea range)

public void clearRange(CellArea range)

Clears contents and formatting of a range.

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearRange(int startRow, int startColumn, int endRow, int endColumn)

public void clearRange(int startRow, int startColumn, int endRow, int endColumn)

Clears contents and formatting of a range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

convertStringToNumericValue()

public void convertStringToNumericValue()

Converts all string data in the worksheet to numeric value if possible.

copyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex)

public void copyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex)

Copies data and formats of a whole column.

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.

copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber)

public void copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber)

Copies data and formats of a whole column.

Parameters:

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.
columnNumberintThe copied column number.

copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber, PasteOptions pasteOptions)

public void copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber, PasteOptions pasteOptions)

Copies data and formats of a whole column.

Parameters:

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.
columnNumberintThe copied column number.
pasteOptionsPasteOptionsthe options of pasting.

copyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns)

public void copyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns)

Copies data and formats of the whole columns.

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
sourceTotalColumnsintThe number of the source columns.
destinationColumnIndexintDestination column index.
destinationTotalColumnsintThe number of the destination columns.

copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)

public void copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)

Copies data and formats of a whole row.

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.

copyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber)

public void copyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber)

Copies data and formats of some whole rows.

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.

copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions)

public void copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions)

Copies data and formats of some whole rows.

Parameters:

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.
copyOptionsCopyOptionsThe copy options.

copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions, PasteOptions pasteOptions)

public void copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions, PasteOptions pasteOptions)

Copies data and formats of some whole rows.

Parameters:

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.
copyOptionsCopyOptionsThe copy options.
pasteOptionsPasteOptionsthe options of pasting.

createRange(int firstIndex, int number, boolean isVertical)

public Range createRange(int firstIndex, int number, boolean isVertical)

Creates a Range object from rows of cells or columns of cells.

Parameters:

ParameterTypeDescription
firstIndexintFirst row index or first column index, zero based.
numberintTotal number of rows or columns, one based.
isVerticalbooleanTrue - Range created from columns of cells. False - Range created from rows of cells.

Returns: Range - A Range object.

createRange(int firstRow, int firstColumn, int totalRows, int totalColumns)

public Range createRange(int firstRow, int firstColumn, int totalRows, int totalColumns)

Creates a Range object from a range of cells.

Parameters:

ParameterTypeDescription
firstRowintFirst row of this range
firstColumnintFirst column of this range
totalRowsintNumber of rows
totalColumnsintNumber of columns

Returns: Range - A Range object

createRange(String address)

public Range createRange(String address)

Creates a Range object from an address of the range.

Parameters:

ParameterTypeDescription
addressjava.lang.StringThe address of the range.

Returns: Range - A Range object

createRange(String upperLeftCell, String lowerRightCell)

public Range createRange(String upperLeftCell, String lowerRightCell)

Creates a Range object from a range of cells.

Parameters:

ParameterTypeDescription
upperLeftCelljava.lang.StringUpper left cell name.
lowerRightCelljava.lang.StringLower right cell name.

Returns: Range - A Range object

deleteBlankColumns()

public void deleteBlankColumns()

Delete all blank columns which do not contain any data.

deleteBlankColumns(DeleteOptions options)

public void deleteBlankColumns(DeleteOptions options)

Delete all blank columns which do not contain any data.

Parameters:

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

deleteBlankRows()

public void deleteBlankRows()

Delete all blank rows which do not contain any data or other object.

deleteBlankRows(DeleteOptions options)

public void deleteBlankRows(DeleteOptions options)

Delete all blank rows which do not contain any data or other object.

Remarks

For blank rows that will be deleted, it is not only required that Row.isBlank() should be true, but also there should be no visible comment defined for any cell in those rows, and no pivot table whose range intersects with them.

Parameters:

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

deleteColumn(int columnIndex)

public void deleteColumn(int columnIndex)

Deletes a column.

Parameters:

ParameterTypeDescription
columnIndexintIndex of the column to be deleted.

deleteColumn(int columnIndex, boolean updateReference)

public void deleteColumn(int columnIndex, boolean updateReference)

Deletes a column.

Parameters:

ParameterTypeDescription
columnIndexintIndex of the column to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteColumns(int columnIndex, int totalColumns, boolean updateReference)

public void deleteColumns(int columnIndex, int totalColumns, boolean updateReference)

Deletes several columns.

Parameters:

ParameterTypeDescription
columnIndexintIndex of the first column to be deleted.
totalColumnsintCount of columns to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRange(int startRow, int startColumn, int endRow, int endColumn, int shiftType)

public void deleteRange(int startRow, int startColumn, int endRow, int endColumn, int shiftType)

Deletes a range of cells and shift cells according to the shift option.

Parameters:

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.
shiftTypeintShiftType. Shift cells option.

deleteRow(int rowIndex)

public void deleteRow(int rowIndex)

Deletes a row.

Parameters:

ParameterTypeDescription
rowIndexintIndex of the row to be deleted.

deleteRow(int rowIndex, boolean updateReference)

public void deleteRow(int rowIndex, boolean updateReference)

Deletes a row.

Parameters:

ParameterTypeDescription
rowIndexintIndex of the row to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRows(int rowIndex, int totalRows)

public boolean deleteRows(int rowIndex, int totalRows)

Deletes several rows.

Remarks

If the deleted range contains the top part(not whole) of the table(ListObject), the ranged could not be deleted and nothing will be done. It works in the same way with MS Excel.

Parameters:

ParameterTypeDescription
rowIndexintThe first row index to be deleted.
totalRowsintCount of rows to be deleted.

Returns: boolean

deleteRows(int rowIndex, int totalRows, boolean updateReference)

public boolean deleteRows(int rowIndex, int totalRows, boolean updateReference)

Deletes multiple rows in the worksheet.

Parameters:

ParameterTypeDescription
rowIndexintIndex of the first row to be deleted.
totalRowsintCount of rows to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

Returns: boolean -

dispose()

public void dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

endCellInColumn(int startRow, int endRow, short startColumn, short endColumn)

public Cell endCellInColumn(int startRow, int endRow, short startColumn, short endColumn)

Gets the last cell with maximum column index in this range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
startColumnshortStart column index.
endColumnshortEnd column index.

Returns: Cell - Cell object.

endCellInColumn(short columnIndex)

public Cell endCellInColumn(short columnIndex)

Gets the last cell in this column.

Parameters:

ParameterTypeDescription
columnIndexshortColumn index.

Returns: Cell - Cell object.

endCellInRow(int rowIndex)

public Cell endCellInRow(int rowIndex)

Gets the last cell in this row.

Parameters:

ParameterTypeDescription
rowIndexintRow index.

Returns: Cell - Cell object.

endCellInRow(int startRow, int endRow, int startColumn, int endColumn)

public Cell endCellInRow(int startRow, int endRow, int startColumn, int endColumn)

Gets the last cell with maximum row index in this range.

Parameters:

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
startColumnintStart column index.
endColumnintEnd column index.

Returns: Cell - Cell object.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

exportArray(int firstRow, int firstColumn, int totalRows, int totalColumns)

public Object[][] exportArray(int firstRow, int firstColumn, int totalRows, int totalColumns)

Exports data in the Cells collection to a two-dimension array object.

Parameters:

ParameterTypeDescription
firstRowintThe row number of the first cell to export out.
firstColumnintThe column number of the first cell to export out.
totalRowsintNumber of rows to be exported
totalColumnsintNumber of columns to be exported

Returns: java.lang.Object[][] - Exported cell value array object.

exportTypeArray(int firstRow, int firstColumn, int totalRows, int totalColumns)

public int[][] exportTypeArray(int firstRow, int firstColumn, int totalRows, int totalColumns)

Exports cell value type in the Cells collection to a two-dimension array object.

Parameters:

ParameterTypeDescription
firstRowintThe row number of the first cell to export out.
firstColumnintThe column number of the first cell to export out.
totalRowsintNumber of rows to be exported.
totalColumnsintNumber of columns to be exported.

Returns: int[][] - CellValueType. Exported array object representing cell value types.

find(Object what, Cell previousCell)

public Cell find(Object what, Cell previousCell)

Finds the cell containing with the input object.

Remarks

Returns null (Nothing) if no cell is found.

Parameters:

ParameterTypeDescription
whatjava.lang.ObjectThe object to search for. The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. This parameter can be set to null if searching from the start.

Returns: Cell - Cell object.

find(Object what, Cell previousCell, FindOptions findOptions)

public Cell find(Object what, Cell previousCell, FindOptions findOptions)

Finds the cell containing with the input object.

Remarks

Returns null (Nothing) if no cell is found.

Parameters:

ParameterTypeDescription
whatjava.lang.ObjectThe object to search for. The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. This parameter can be set to null if searching from the start.
findOptionsFindOptionsFind options

Returns: Cell - Cell object.

get(int row, int column)

public Cell get(int row, int column)

Gets the Cell element at the specified cell row index and column index.

Example

         Workbook excel = new Workbook();
         Cells cells = excel.getWorksheets().get(0).getCells();
         Cell cell = cells.get(0, 0);	//Gets the cell at "A1"

Parameters:

ParameterTypeDescription
rowintRow index.
columnintColumn index.

Returns: Cell - The Cell object.

get(String cellName)

public Cell get(String cellName)

Gets the Cell element at the specified cell name.

Example

         Workbook excel = new Workbook();
         Cells cells = excel.getWorksheets().get(0).getCells();
         Cell cell = cells.get("A1");	//Gets the cell at "A1"

Parameters:

ParameterTypeDescription
cellNamejava.lang.StringCell name,including its column letter and row number, for example A5.

Returns: Cell - A Cell object

getCellStyle(int row, int column)

public Style getCellStyle(int row, int column)

Get the style of given cell.

Parameters:

ParameterTypeDescription
rowintrow index
columnintcolumn

Returns: Style - the style of given cell.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColumnOriginalWidthPoint(int column)

public double getColumnOriginalWidthPoint(int column)

Gets original column’s height in unit of point if the column is hidden

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
columnintThe row index.

Returns: double - Width of column in normal view.

getColumnWidth(int column)

public double getColumnWidth(int column)

Gets the width(in unit of characters) of the specified column in normal view

Parameters:

ParameterTypeDescription
columnintColumn index

Returns: double - Width of column. For spreadsheet, column width is measured as the number of characters of the maximum digit width of the numbers 0~9 as rendered in the normal style’s font.

getColumnWidth(int column, boolean isOriginal, int unitType)

public double getColumnWidth(int column, boolean isOriginal, int unitType)

Gets the column width.

Parameters:

ParameterTypeDescription
columnintThe column index.
isOriginalbooleanIndicates whether getting original width.
unitTypeintCellsUnitType.

Returns: double -

getColumnWidthInch(int column)

public double getColumnWidthInch(int column)

Gets the width of the specified column in normal view, in units of inches.

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
columnintColumn index

Returns: double - Width of column in normal view.

getColumnWidthPixel(int column)

public int getColumnWidthPixel(int column)

Gets the width of the specified column in normal view, in units of pixel.

Parameters:

ParameterTypeDescription
columnintColumn index

Returns: int - Width of column in normal view.

getColumnWidthPixel(int column, boolean original)

public int getColumnWidthPixel(int column, boolean original)

Gets the width of the specified column in normal view, in units of pixel.

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
columnintColumn index
originalbooleanIndicates whether returning original width even when the column is hidden

Returns: int - Width of column in normal view.

getColumns()

public ColumnCollection getColumns()

Gets the collection of Column objects that represents the individual columns in this worksheet.

Returns: ColumnCollection

getCount()

public int getCount()

Gets the total count of instantiated Cell objects.

Returns: int

getCountLarge()

public long getCountLarge()

Gets the total count of instantiated Cell objects.

Returns: long

getDependents(boolean isAll, int row, int column)

public Cell[] getDependents(boolean isAll, int row, int column)

Get all cells which refer to the specific cell.

Parameters:

ParameterTypeDescription
isAllbooleanIndicates whether check other worksheets
rowintThe row index.
columnintThe column index.

Returns: com.aspose.cells.Cell[] -

getDependentsInCalculation(int row, int column, boolean recursive)

public Iterator getDependentsInCalculation(int row, int column, boolean recursive)

Gets all cells whose calculated result depends on specific cell.

Remarks

To use this method, please make sure the workbook has been set with true value for FormulaSettings.getEnableCalculationChain() and has been fully calculated with this setting. If there is no formula reference to this cell, null will be returned. For more details and example, please see Cell.getDependentsInCalculation(boolean)

Parameters:

ParameterTypeDescription
rowintRow index of the specific cell
columnintColumn index of the specific cell.
recursivebooleanWhether returns those dependents which do not reference to the specific cell directly but reference to other leafs of that cell.

Returns: java.util.Iterator - Enumerator to enumerate all dependents(Cell objects)

getFirstCell()

public Cell getFirstCell()

Gets the first cell in this worksheet.

Remarks

Returns null if there is no data in the worksheet.

Returns: Cell

getGroupedColumnOutlineLevel(int columnIndex)

public int getGroupedColumnOutlineLevel(int columnIndex)

Gets the outline level (zero-based) of the column.

Remarks

If the column is not grouped, returns zero.

Parameters:

ParameterTypeDescription
columnIndexintThe column index

Returns: int - The outline level of the column

getGroupedRowOutlineLevel(int rowIndex)

public int getGroupedRowOutlineLevel(int rowIndex)

Gets the outline level (zero-based) of the row.

Remarks

If the row is not grouped, returns zero.

Parameters:

ParameterTypeDescription
rowIndexintThe row index.

Returns: int - The outline level (zero-based) of the row.

getLastCell()

public Cell getLastCell()

Gets the last cell in this worksheet.

Remarks

Returns null if there is no data in the worksheet.

Returns: Cell

getLastDataRow(int column)

public int getLastDataRow(int column)

Gets the last row index of cell which contains data in the specified column.

Parameters:

ParameterTypeDescription
columnintColumn index.

Returns: int - last row index.

getMaxColumn()

public int getMaxColumn()

Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

Remarks

Return -1 if there is no cell.

Returns: int

getMaxDataColumn()

public int getMaxDataColumn()

Maximum column index of cell which contains data.

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet, so it is a time-consumed progress and should not be invoked repeatedly.

Returns: int

getMaxDataRow()

public int getMaxDataRow()

Maximum row index of cell which contains data.

Remarks

Return -1 if there is no cell which contains data.

Returns: int

getMaxDisplayRange()

public Range getMaxDisplayRange()

Gets the max range which includes data, merged cells and shapes.

Remarks

Reutrns null if the worksheet is empty since Aspose.Cells 21.5.2.

Returns: Range

getMaxGroupedColumnOutlineLevel()

public int getMaxGroupedColumnOutlineLevel()

Gets the max grouped column outline level (zero-based).

Returns: int - The max grouped column outline level (zero-based)

getMaxGroupedRowOutlineLevel()

public int getMaxGroupedRowOutlineLevel()

Gets the max grouped row outline level (zero-based).

Returns: int - The max grouped row outline level (zero-based)

getMaxRow()

public int getMaxRow()

Maximum row index of cell which contains data or style.

Remarks

Return -1 if there is no cell which contains data or style in the worksheet.

Returns: int

getMemorySetting()

public int getMemorySetting()

Gets the memory usage option for this cells.

See MemorySetting.

Returns: int

getMergedAreas()

public CellArea[] getMergedAreas()

Gets all merged cells.

Returns: com.aspose.cells.CellArea[]

getMergedCells()

public ArrayList getMergedCells()

Gets the collection of merged cells.

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetMergedAreas() method. This method will be removed 12 months later since November 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.util.ArrayList

getMinColumn()

public int getMinColumn()

Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

Returns: int

getMinDataColumn()

public int getMinDataColumn()

Minimum column index of cell which contains data.

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet, so it is a time-consumed progress and should not be invoked repeatedly.

Returns: int

getMinDataRow()

public int getMinDataRow()

Minimum row index of cell which contains data.

Returns: int

getMinRow()

public int getMinRow()

Minimum row index of cell which contains data or style.

Returns: int

getMultiThreadReading()

public boolean getMultiThreadReading()

Gets whether the cells data model should support Multi-Thread reading. Default value of this property is false.

Remarks

If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.getStringValue(), Cell.getDisplayStringValue(), .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

Returns: boolean

getOdsCellFields()

public OdsCellFieldCollection getOdsCellFields()

Gets the list of fields of ods.

Returns: OdsCellFieldCollection

getPreserveString()

public boolean getPreserveString()

Gets a value indicating whether all worksheet values are preserved as strings. Default is false.

Returns: boolean

getRanges()

public RangeCollection getRanges()

Gets the collection of Range objects created at run time.

Returns: RangeCollection

getRowEnumerator()

public Iterator getRowEnumerator()

Gets the rows enumerator.

Remarks

NOTE: This member is now obsolete. Instead, please use RowCollection.GetEnumerator() method. This method will be removed 12 months later since May 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.util.Iterator - The rows enumerator.

getRowHeight(int row)

public double getRowHeight(int row)

Gets the height of a specified row, in unit of points.

Parameters:

ParameterTypeDescription
rowintRow index

Returns: double - Height of row

getRowHeight(int row, boolean isOriginal, int unitType)

public double getRowHeight(int row, boolean isOriginal, int unitType)

Gets row’s height.

Parameters:

ParameterTypeDescription
rowintThe row index.
isOriginalbooleanWhether returns the original row height or 0 for hidden row.
unitTypeintCellsUnitType. Unit type of the returned height value

Returns: double - Row’s height

getRowHeightInch(int row)

public double getRowHeightInch(int row)

Gets the height of a specified row in unit of inches.

Parameters:

ParameterTypeDescription
rowintRow index

Returns: double - Height of row

getRowHeightPixel(int row)

public int getRowHeightPixel(int row)

Gets the height of a specified row in unit of pixel.

Parameters:

ParameterTypeDescription
rowintRow index

Returns: int - Height of row

getRowOriginalHeightPoint(int row)

public double getRowOriginalHeightPoint(int row)

Gets original row’s height in unit of point if the row is hidden

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.GetRowHeight(int,bool,CellsUnitType) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
rowintThe row index.

Returns: double -

getRows()

public RowCollection getRows()

Gets the collection of Row objects that represents the individual rows in this worksheet.

Returns: RowCollection

getStandardHeight()

public double getStandardHeight()

Gets the default row height in this worksheet, in unit of points.

Returns: double

getStandardHeightInch()

public double getStandardHeightInch()

Gets the default row height in this worksheet, in unit of inches.

Returns: double

getStandardHeightPixels()

public int getStandardHeightPixels()

Gets the default row height in this worksheet, in unit of pixels.

Returns: int

getStandardWidth()

public double getStandardWidth()

Gets the default column width in the worksheet, in unit of characters.

Returns: double

getStandardWidthInch()

public double getStandardWidthInch()

Gets the default column width in the worksheet, in unit of inches.

Returns: double

getStandardWidthPixels()

public int getStandardWidthPixels()

Gets the default column width in the worksheet, in unit of pixels.

Returns: int

getStyle()

public Style getStyle()

Gets the default style of the worksheet.

Returns: Style

getViewColumnWidthPixel(int column)

public int getViewColumnWidthPixel(int column)

Get the width in different view type.

Parameters:

ParameterTypeDescription
columnintThe column index.

Returns: int - the column width in unit of pixels

getViewRowHeight(int row)

public double getViewRowHeight(int row)

Gets the height of a specified row.

Parameters:

ParameterTypeDescription
rowintRow index.

Returns: double - Height of row.

getViewRowHeightInch(int row)

public double getViewRowHeightInch(int row)

Gets the height of a specified row in unit of inches.

Parameters:

ParameterTypeDescription
rowintRow index

Returns: double - Height of row

groupColumns(int firstIndex, int lastIndex)

public void groupColumns(int firstIndex, int lastIndex)

Groups columns.

Parameters:

ParameterTypeDescription
firstIndexintThe first column index to be grouped.
lastIndexintThe last column index to be grouped.

groupColumns(int firstIndex, int lastIndex, boolean isHidden)

public void groupColumns(int firstIndex, int lastIndex, boolean isHidden)

Groups columns.

Parameters:

ParameterTypeDescription
firstIndexintThe first column index to be grouped.
lastIndexintThe last column index to be grouped.
isHiddenbooleanSpecifies if the grouped columns are hidden.

groupRows(int firstIndex, int lastIndex)

public void groupRows(int firstIndex, int lastIndex)

Groups rows.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be grouped.
lastIndexintThe last row index to be grouped.

groupRows(int firstIndex, int lastIndex, boolean isHidden)

public void groupRows(int firstIndex, int lastIndex, boolean isHidden)

Groups rows.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be grouped.
lastIndexintThe last row index to be grouped.
isHiddenbooleanSpecifies if the grouped rows are hidden.

hashCode()

public native int hashCode()

Returns: int

hideColumn(int column)

public void hideColumn(int column)

Hides a column.

Parameters:

ParameterTypeDescription
columnintColumn index.

hideColumns(int column, int totalColumns)

public void hideColumns(int column, int totalColumns)

Hide multiple columns.

Parameters:

ParameterTypeDescription
columnintColumn index.
totalColumnsintColumn number.

hideGroupDetail(boolean isVertical, int index)

public void hideGroupDetail(boolean isVertical, int index)

Collapses the grouped rows/columns.

Parameters:

ParameterTypeDescription
isVerticalbooleanTrue, collapse the grouped rows.
indexintThe row/column index

hideRow(int row)

public void hideRow(int row)

Hides a row.

Parameters:

ParameterTypeDescription
rowintRow index.

hideRows(int row, int totalRows)

public void hideRows(int row, int totalRows)

Hides multiple rows.

Parameters:

ParameterTypeDescription
rowintThe row index.
totalRowsintThe row number.

importArray(double[] doubleArray, int firstRow, int firstColumn, boolean isVertical)

public void importArray(double[] doubleArray, int firstRow, int firstColumn, boolean isVertical)

Imports an array of double into a worksheet.

Parameters:

ParameterTypeDescription
doubleArraydouble[]Double array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importArray(double[][] doubleArray, int firstRow, int firstColumn)

public void importArray(double[][] doubleArray, int firstRow, int firstColumn)

Imports a two-dimension array of double into a worksheet.

Parameters:

ParameterTypeDescription
doubleArraydouble[][]Two-dimension double array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importArray(int[] intArray, int firstRow, int firstColumn, boolean isVertical)

public void importArray(int[] intArray, int firstRow, int firstColumn, boolean isVertical)

Imports an array of integer into a worksheet.

Parameters:

ParameterTypeDescription
intArrayint[]Integer array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importArray(int[][] intArray, int firstRow, int firstColumn)

public void importArray(int[][] intArray, int firstRow, int firstColumn)

Imports a two-dimension array of integer into a worksheet.

Parameters:

ParameterTypeDescription
intArrayint[][]Two-dimension integer array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)

public void importArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)

Imports an array of string into a worksheet.

Parameters:

ParameterTypeDescription
stringArrayjava.lang.String[]String array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importArray(String[][] stringArray, int firstRow, int firstColumn)

public void importArray(String[][] stringArray, int firstRow, int firstColumn)

Imports a two-dimension array of string into a worksheet.

Parameters:

ParameterTypeDescription
stringArrayjava.lang.String[][]Two-dimension string array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importArrayList(ArrayList arrayList, int firstRow, int firstColumn, boolean isVertical)

public void importArrayList(ArrayList arrayList, int firstRow, int firstColumn, boolean isVertical)

Imports an arraylist of data into a worksheet.

Parameters:

ParameterTypeDescription
arrayListjava.util.ArrayListData arraylist.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importCSV(InputStream stream, TxtLoadOptions options, int firstRow, int firstColumn)

public void importCSV(InputStream stream, TxtLoadOptions options, int firstRow, int firstColumn)

Import a CSV file to the cells.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe CSV file stream.
optionsTxtLoadOptionsThe load options for reading text file
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importCSV(InputStream stream, String splitter, boolean convertNumericData, int firstRow, int firstColumn)

public void importCSV(InputStream stream, String splitter, boolean convertNumericData, int firstRow, int firstColumn)

Import a CSV file to the cells.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe CSV file stream.
splitterjava.lang.StringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importCSV(String fileName, TxtLoadOptions options, int firstRow, int firstColumn)

public void importCSV(String fileName, TxtLoadOptions options, int firstRow, int firstColumn)

Import a CSV file to the cells.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringThe CSV file name.
optionsTxtLoadOptionsThe load options for reading text file
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importCSV(String fileName, String splitter, boolean convertNumericData, int firstRow, int firstColumn)

public void importCSV(String fileName, String splitter, boolean convertNumericData, int firstRow, int firstColumn)

Import a CSV file to the cells.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringThe CSV file name.
splitterjava.lang.StringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importCustomObjects(Collection list, int firstRow, int firstColumn, ImportTableOptions options)

public int importCustomObjects(Collection list, int firstRow, int firstColumn, ImportTableOptions options)

Imports custom objects.

Remarks

The custom objects should be the same type.

Parameters:

ParameterTypeDescription
listjava.util.CollectionThe custom object
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
optionsImportTableOptionsThe import options.

Returns: int - Total number of rows imported.

importCustomObjects(Collection list, String[] propertyNames, boolean isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, boolean insertRows, String dateFormatString, boolean convertStringToNumber)

public int importCustomObjects(Collection list, String[] propertyNames, boolean isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, boolean insertRows, String dateFormatString, boolean convertStringToNumber)

Imports custom objects.

Remarks

The custom objects should be the same type.

Parameters:

ParameterTypeDescription
listjava.util.CollectionThe custom object
propertyNamesjava.lang.String[]The property names.If it is null,we will import all properties of the object.
isPropertyNameShownbooleanIndicates whether the property name will be imported to the first row.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
rowNumberintNumber of rows to be imported.
insertRowsbooleanIndicates whether extra rows are added to fit data.
dateFormatStringjava.lang.StringDate format string for cells.
convertStringToNumberbooleanIndicates if this method will try to convert string to number.

Returns: int - Total number of rows imported.

importData(ICellsDataTable table, int firstRow, int firstColumn, ImportTableOptions options)

public int importData(ICellsDataTable table, int firstRow, int firstColumn, ImportTableOptions options)

Import data from custom data table.

Parameters:

ParameterTypeDescription
tableICellsDataTableThe custom data table.
firstRowintFirst row index.
firstColumnintFirst column index.
optionsImportTableOptionsThe import options

Returns: int -

importFormulaArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)

public void importFormulaArray(String[] stringArray, int firstRow, int firstColumn, boolean isVertical)

Imports an array of formula into a worksheet.

Parameters:

ParameterTypeDescription
stringArrayjava.lang.String[]Formula array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical)

public void importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical)

Imports an array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[]Data array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical, int skip)

public void importObjectArray(Object[] objArray, int firstRow, int firstColumn, boolean isVertical, int skip)

Imports an array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[]Data array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.
skipintSkipped number of rows or columns.

importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown)

public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
rowIndexintstart row index in the worksheet.
columnIndexintstart column index in the worksheet.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)

public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
rowIndexintstart row index in the worksheet.
columnIndexintstart column index in the worksheet.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.
customDateFormatStringjava.lang.StringDate format string for cells which contain date value.
convertStringToNumberbooleanIndicates if this method will try to convert string to number.

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, int rowIndex, int columnIndex, ImportTableOptions options)

public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, ImportTableOptions options)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
rowIndexintstart row index in the worksheet.
columnIndexintstart column index in the worksheet.
optionsImportTableOptionsThe import options

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown)

public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
rowIndexintstart row index in the worksheet.
columnIndexintstart column index in the worksheet.
rowNumintnumber of rows to import. -1 to import all records in given resultset.
columnNumintnumber of columns to import. -1 to import all columns in given resultset.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)

public int importResultSet(ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, String customDateFormatString, boolean convertStringToNumber)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
rowIndexintstart row index in the worksheet.
columnIndexintstart column index in the worksheet.
rowNumintnumber of rows to import. -1 to import all records in given resultset.
columnNumintnumber of columns to import. -1 to import all columns in given resultset.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.
customDateFormatStringjava.lang.StringDate format string for cells which contain date value.
convertStringToNumberbooleanIndicates if this method will try to convert string to number.

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, String startCell, boolean isFieldNameShown)

public int importResultSet(ResultSet rs, String startCell, boolean isFieldNameShown)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
startCelljava.lang.Stringname of start cell to insert the resultset, such as “A1”.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, String startCell, ImportTableOptions options)

public int importResultSet(ResultSet rs, String startCell, ImportTableOptions options)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
startCelljava.lang.Stringname of start cell to insert the resultset, such as “A1”.
optionsImportTableOptionsThe import options

Returns: int - how many rows actually imported.

importResultSet(ResultSet rs, String startCell, int rowNum, int columnNum, boolean isFieldNameShown)

public int importResultSet(ResultSet rs, String startCell, int rowNum, int columnNum, boolean isFieldNameShown)

Imports data in a ResultSet object to the worksheet.

Parameters:

ParameterTypeDescription
rsjava.sql.ResultSetthe ResultSet object to import from.
startCelljava.lang.Stringname of start cell to insert the resultset, such as “A1”.
rowNumintnumber of rows to import. -1 to import all records in given resultset.
columnNumintnumber of columns to import. -1 to import all columns in given resultset.
isFieldNameShownbooleanIndicates whether the field name of the resultset will be imported to the first row.

Returns: int - how many rows actually imported.

importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn)

public void importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn)

Imports a two-dimension array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[][]Two-dimension data array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn, boolean convertStringToNumber)

public void importTwoDimensionArray(Object[][] objArray, int firstRow, int firstColumn, boolean convertStringToNumber)

Imports a two-dimension array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[][]Two-dimension data array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
convertStringToNumberbooleanIndicates if this method will try to convert string to number.

importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, boolean convertStringToNumber)

public void importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, boolean convertStringToNumber)

Imports a two-dimension array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[][]Two-dimension data array.
stylesjava.lang.Object[][]Two-dimension data style.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
convertStringToNumberbooleanIndicates if this method will try to convert string to number.

importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, TxtLoadOptions opts)

public void importTwoDimensionArray(Object[][] objArray, Object[][] styles, int firstRow, int firstColumn, TxtLoadOptions opts)

Imports a two-dimension array of data into a worksheet.

Parameters:

ParameterTypeDescription
objArrayjava.lang.Object[][]Two-dimension data array.
stylesjava.lang.Object[][]Two-dimension data style.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
optsTxtLoadOptionsOptions for converting string values

insertColumn(int columnIndex)

public void insertColumn(int columnIndex)

Inserts a new column into the worksheet.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.

insertColumn(int columnIndex, boolean updateReference)

public void insertColumn(int columnIndex, boolean updateReference)

Inserts a new column into the worksheet.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertColumns(int columnIndex, int totalColumns)

public void insertColumns(int columnIndex, int totalColumns)

Inserts some columns into the worksheet.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.
totalColumnsintThe number of columns.

insertColumns(int columnIndex, int totalColumns, boolean updateReference)

public void insertColumns(int columnIndex, int totalColumns, boolean updateReference)

Inserts some columns into the worksheet.

Parameters:

ParameterTypeDescription
columnIndexintColumn index.
totalColumnsintThe number of columns.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertCutCells(Range cutRange, int row, int column, int shiftType)

public void insertCutCells(Range cutRange, int row, int column, int shiftType)

Insert cut range.

Parameters:

ParameterTypeDescription
cutRangeRangeThe cut range.
rowintThe row.
columnintThe column.
shiftTypeintShiftType. The shift type .

insertRange(CellArea area, int shiftType)

public void insertRange(CellArea area, int shiftType)

Inserts a range of cells and shift cells according to the shift option.

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftTypeintShiftType. Shift cells option.

insertRange(CellArea area, int shiftNumber, int shiftType)

public void insertRange(CellArea area, int shiftNumber, int shiftType)

Inserts a range of cells and shift cells according to the shift option.

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftNumberintNumber of rows or columns to be inserted.
shiftTypeintShiftType. Shift cells option.

insertRange(CellArea area, int shiftNumber, int shiftType, boolean updateReference)

public void insertRange(CellArea area, int shiftNumber, int shiftType, boolean updateReference)

Inserts a range of cells and shift cells according to the shift option.

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftNumberintNumber of rows or columns to be inserted.
shiftTypeintShiftType. Shift cells option.
updateReferencebooleanIndicates whether update references in other worksheets.

insertRow(int rowIndex)

public void insertRow(int rowIndex)

Inserts a new row into the worksheet.

Parameters:

ParameterTypeDescription
rowIndexintRow index.

insertRows(int rowIndex, int totalRows)

public void insertRows(int rowIndex, int totalRows)

Inserts multiple rows into the worksheet.

Parameters:

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.

insertRows(int rowIndex, int totalRows, boolean updateReference)

public void insertRows(int rowIndex, int totalRows, boolean updateReference)

Inserts multiple rows into the worksheet.

Parameters:

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertRows(int rowIndex, int totalRows, InsertOptions options)

public void insertRows(int rowIndex, int totalRows, InsertOptions options)

Inserts multiple rows into the worksheet.

Parameters:

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.
optionsInsertOptionsIndicates if references in other worksheets will be updated.

isBlankColumn(int columnIndex)

public boolean isBlankColumn(int columnIndex)

Checks whether given column is blank(does not contain any data).

Parameters:

ParameterTypeDescription
columnIndexintthe column index

Returns: boolean - true if given column does not contain any data

isColumnHidden(int columnIndex)

public boolean isColumnHidden(int columnIndex)

Checks whether a column at given index is hidden.

Parameters:

ParameterTypeDescription
columnIndexintcolumn index

Returns: boolean - true if the column is hidden.

isDefaultRowHeightMatched()

public boolean isDefaultRowHeightMatched()

Indicates that row height and default font height matches

Returns: boolean

isDefaultRowHidden()

public boolean isDefaultRowHidden()

Indicates whether the row is default hidden.

Returns: boolean

isDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns)

public boolean isDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns)

Check whether the range could be deleted.

Parameters:

ParameterTypeDescription
startRowintThe start row index of the range.
startColumnintThe start column index of the range.
totalRowsintThe number of the rows in the range.
totalColumnsintThe number of the columns in the range.

Returns: boolean -

isRowHidden(int rowIndex)

public boolean isRowHidden(int rowIndex)

Checks whether a row at given index is hidden.

Parameters:

ParameterTypeDescription
rowIndexintrow index

Returns: boolean - true if the row is hidden

iterator()

public Iterator iterator()

Gets the cells enumerator.

Remarks

When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).

Example

         Workbook workbook = new Workbook("template.xlsx");
         	Cells cells = workbook.getWorksheets().get(0).getCells();
 
         	Iterator en = cells.iterator();
         	while (en.hasNext())
         	{
         	    Cell cell = (Cell)en.next();
         	    System.out.println(cell.getName() + ": " + cell.getValue());
         	}

Returns: java.util.Iterator - The cells enumerator

linkToXmlMap(String mapName, int row, int column, String path)

public void linkToXmlMap(String mapName, int row, int column, String path)

Link to a xml map.

Parameters:

ParameterTypeDescription
mapNamejava.lang.Stringname of xml map
rowintrow of the destination cell
columnintcolumn of the destination cell
pathjava.lang.Stringpath of xml element in xml map

merge(int firstRow, int firstColumn, int totalRows, int totalColumns)

public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns)

Merges a specified range of cells into a single cell.

Remarks

Reference the merged cell via the address of the upper-left cell in the range.

Parameters:

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)

merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean mergeConflict)

public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean mergeConflict)

Merges a specified range of cells into a single cell.

Remarks

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

Parameters:

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)
mergeConflictbooleanMerge conflict merged ranges.

merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean checkConflict, boolean mergeConflict)

public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean checkConflict, boolean mergeConflict)

Merges a specified range of cells into a single cell.

Remarks

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

Parameters:

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)
checkConflictbooleanIndicates whether check the merged cells intersects other merged cells
mergeConflictbooleanMerge conflict merged ranges.

moveRange(CellArea sourceArea, int destRow, int destColumn)

public void moveRange(CellArea sourceArea, int destRow, int destColumn)

Moves the range.

Parameters:

ParameterTypeDescription
sourceAreaCellAreaThe range which should be moved.
destRowintThe dest row.
destColumnintThe dest column.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeDuplicates()

public void removeDuplicates()

Removes duplicate rows in the sheet.

removeDuplicates(int startRow, int startColumn, int endRow, int endColumn)

public void removeDuplicates(int startRow, int startColumn, int endRow, int endColumn)

Removes duplicate values in the range.

Parameters:

ParameterTypeDescription
startRowintThe start row.
startColumnintThe start column
endRowintThe end row index.
endColumnintThe end column index.

removeDuplicates(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders, int[] columnOffsets)

public void removeDuplicates(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders, int[] columnOffsets)

Removes duplicate data of the range.

Parameters:

ParameterTypeDescription
startRowintThe start row.
startColumnintThe start column
endRowintThe end row index.
endColumnintThe end column index.
hasHeadersbooleanIndicates whether the range contains headers.
columnOffsetsint[]The column offsets.

removeFormulas()

public void removeFormulas()

Removes all formula and replaces with the value of the formula.

retrieveSubtotalSetting(CellArea ca)

public SubtotalSetting retrieveSubtotalSetting(CellArea ca)

Retrieves subtotals setting of the range.

Parameters:

ParameterTypeDescription
caCellAreaThe range

Returns: SubtotalSetting -

setColumnWidth(int column, double width)

public void setColumnWidth(int column, double width)

Sets the width of the specified column in normal view.

Remarks

To hide a column, sets column width to zero.

Parameters:

ParameterTypeDescription
columnintColumn index.
widthdoubleWidth of column.Column width must be between 0 and 255.

setColumnWidthInch(int column, double inches)

public void setColumnWidthInch(int column, double inches)

Sets column width in unit of inches in normal view.

Parameters:

ParameterTypeDescription
columnintColumn index.
inchesdoubleNumber of inches.

setColumnWidthPixel(int column, int pixels)

public void setColumnWidthPixel(int column, int pixels)

Sets column width in unit of pixels in normal view.

Parameters:

ParameterTypeDescription
columnintColumn index.
pixelsintNumber of pixels.

setDefaultRowHeightMatched(boolean value)

public void setDefaultRowHeightMatched(boolean value)

Indicates that row height and default font height matches

Parameters:

ParameterTypeDescription
valueboolean

setDefaultRowHidden(boolean value)

public void setDefaultRowHidden(boolean value)

Indicates whether the row is default hidden.

Parameters:

ParameterTypeDescription
valueboolean

setMemorySetting(int value)

public void setMemorySetting(int value)

Sets the memory usage option for this cells.

See MemorySetting.

Parameters:

ParameterTypeDescription
valueint

setMultiThreadReading(boolean value)

public void setMultiThreadReading(boolean value)

Sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.

Remarks

If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.getStringValue(), Cell.getDisplayStringValue(), .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

Parameters:

ParameterTypeDescription
valueboolean

setPreserveString(boolean value)

public void setPreserveString(boolean value)

Sets a value indicating whether all worksheet values are preserved as strings. Default is false.

Parameters:

ParameterTypeDescription
valueboolean

setRowHeight(int row, double height)

public void setRowHeight(int row, double height)

Sets the height of the specified row.

Parameters:

ParameterTypeDescription
rowintRow index.
heightdoubleHeight of row.In unit of point It should be between 0 and 409.5.

setRowHeightInch(int row, double inches)

public void setRowHeightInch(int row, double inches)

Sets row height in unit of inches.

Parameters:

ParameterTypeDescription
rowintRow index.
inchesdoubleNumber of inches. It should be between 0 and 409.5/72.

setRowHeightPixel(int row, int pixels)

public void setRowHeightPixel(int row, int pixels)

Sets row height in unit of pixels.

Parameters:

ParameterTypeDescription
rowintRow index.
pixelsintNumber of pixels.

setStandardHeight(double value)

public void setStandardHeight(double value)

Sets the default row height in this worksheet, in unit of points.

Parameters:

ParameterTypeDescription
valuedouble

setStandardHeightInch(double value)

public void setStandardHeightInch(double value)

Sets the default row height in this worksheet, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setStandardHeightPixels(int value)

public void setStandardHeightPixels(int value)

Sets the default row height in this worksheet, in unit of pixels.

Parameters:

ParameterTypeDescription
valueint

setStandardWidth(double value)

public void setStandardWidth(double value)

Sets the default column width in the worksheet, in unit of characters.

Parameters:

ParameterTypeDescription
valuedouble

setStandardWidthInch(double value)

public void setStandardWidthInch(double value)

Sets the default column width in the worksheet, in unit of inches.

Parameters:

ParameterTypeDescription
valuedouble

setStandardWidthPixels(int value)

public void setStandardWidthPixels(int value)

Sets the default column width in the worksheet, in unit of pixels.

Parameters:

ParameterTypeDescription
valueint

setStyle(Style value)

public void setStyle(Style value)

Sets the default style of the worksheet.

Parameters:

ParameterTypeDescription
valueStyle

setViewColumnWidthPixel(int column, int pixels)

public void setViewColumnWidthPixel(int column, int pixels)

Sets the width of the column in different view.

Remarks

If the current view type is ViewType.PAGE_LAYOUT_VIEW, the column’s width is same as printed width.

Parameters:

ParameterTypeDescription
columnintThe column index.
pixelsintThe width in unit of pixels.

showGroupDetail(boolean isVertical, int index)

public void showGroupDetail(boolean isVertical, int index)

Expands the grouped rows/columns.

Parameters:

ParameterTypeDescription
isVerticalbooleanTrue, expands the grouped rows.
indexintThe row/column index

subtotal(CellArea ca, int groupBy, int function, int[] totalList)

public void subtotal(CellArea ca, int groupBy, int function, int[] totalList)

Creates subtotals for the range.

Parameters:

ParameterTypeDescription
caCellAreaThe range
groupByintThe field to group by, as a zero-based integer offset
functionintConsolidationFunction. The subtotal function.
totalListint[]An array of zero-based field offsets, indicating the fields to which the subtotals are added.

subtotal(CellArea ca, int groupBy, int function, int[] totalList, boolean replace, boolean pageBreaks, boolean summaryBelowData)

public void subtotal(CellArea ca, int groupBy, int function, int[] totalList, boolean replace, boolean pageBreaks, boolean summaryBelowData)

Creates subtotals for the range.

Parameters:

ParameterTypeDescription
caCellAreaThe range
groupByintThe field to group by, as a zero-based integer offset
functionintConsolidationFunction. The subtotal function.
totalListint[]An array of zero-based field offsets, indicating the fields to which the subtotals are added.
replacebooleanIndicates whether replace the current subtotals
pageBreaksbooleanIndicates whether add page break between groups
summaryBelowDatabooleanIndicates whether add summary below data.

textToColumns(int row, int column, int totalRows, TxtLoadOptions options)

public void textToColumns(int row, int column, int totalRows, TxtLoadOptions options)

Splits the text in the column to columns.

Parameters:

ParameterTypeDescription
rowintThe row index.
columnintThe column index.
totalRowsintThe number of rows.
optionsTxtLoadOptionsThe split options.

toString()

public String toString()

Returns: java.lang.String

unMerge(int firstRow, int firstColumn, int totalRows, int totalColumns)

public void unMerge(int firstRow, int firstColumn, int totalRows, int totalColumns)

Unmerges a specified range of merged cells.

Parameters:

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)

ungroupColumns(int firstIndex, int lastIndex)

public void ungroupColumns(int firstIndex, int lastIndex)

Ungroups columns.

Parameters:

ParameterTypeDescription
firstIndexintThe first column index to be ungrouped.
lastIndexintThe last column index to be ungrouped.

ungroupRows(int firstIndex, int lastIndex)

public void ungroupRows(int firstIndex, int lastIndex)

Ungroups rows.

Remarks

Only removes outer group info.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be ungrouped.
lastIndexintThe last row index to be ungrouped.

ungroupRows(int firstIndex, int lastIndex, boolean isAll)

public void ungroupRows(int firstIndex, int lastIndex, boolean isAll)

Ungroups rows.

Parameters:

ParameterTypeDescription
firstIndexintThe first row index to be ungrouped.
lastIndexintThe last row index to be ungrouped.
isAllbooleanTrue, removes all grouped info.Otherwise, remove the outer group info.

unhideColumn(int column, double width)

public void unhideColumn(int column, double width)

Unhides a column

Parameters:

ParameterTypeDescription
columnintColumn index.
widthdoubleColumn width.

unhideColumns(int column, int totalColumns, double width)

public void unhideColumns(int column, int totalColumns, double width)

Unhide multiple columns.

Remarks

Only applies the column width to the hidden columns.

Parameters:

ParameterTypeDescription
columnintColumn index.
totalColumnsintColumn number
widthdoubleColumn width.

unhideRow(int row, double height)

public void unhideRow(int row, double height)

Unhides a row.

Parameters:

ParameterTypeDescription
rowintRow index.
heightdoubleRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

unhideRows(int row, int totalRows, double height)

public void unhideRows(int row, int totalRows, double height)

Unhides the hidden rows.

Parameters:

ParameterTypeDescription
rowintThe row index.
totalRowsintThe row number.
heightdoubleRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int