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).
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).
Imports data in a ResultSet object to the worksheet.
int
importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown)
Imports data in a ResultSet object to the worksheet.
int
importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, java.lang.String customDateFormatString, boolean convertStringToNumber)
Imports data in a ResultSet object to the worksheet.
Gets the collection of Row objects that represents the individual rows in this worksheet.
getMergedCells
public java.util.ArrayList getMergedCells()
Gets the collection of merged cells.
In this collection, each item is a CellArea structure which represents an area of merged cells.
getMultiThreadReading/setMultiThreadReading
public boolean getMultiThreadReading() / public void setMultiThreadReading(boolean value)
Gets or sets whether the cells data model should support Multi-Thread reading.
Default value of this property is false.
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.StringValue, Cell.DisplayStringValue, .etc.).
So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.
getMemorySetting/setMemorySetting
public int getMemorySetting() / public void setMemorySetting(int value)
Gets or sets the memory usage option for this cells.
The value of the property is MemorySetting integer constant.
getStyle/setStyle
public StylegetStyle() / public void setStyle(Style value)
Gets and sets the default style.
getStandardWidthInch/setStandardWidthInch
public double getStandardWidthInch() / public void setStandardWidthInch(double value)
Gets or sets the default column width in the worksheet, in unit of inches.
getStandardWidthPixels/setStandardWidthPixels
public int getStandardWidthPixels() / public void setStandardWidthPixels(int value)
Gets or sets the default column width in the worksheet, in unit of pixels.
getStandardWidth/setStandardWidth
public double getStandardWidth() / public void setStandardWidth(double value)
Gets or sets the default column width in the worksheet, in unit of characters.
getStandardHeight/setStandardHeight
public double getStandardHeight() / public void setStandardHeight(double value)
Gets or sets the default row height in this worksheet, in unit of points.
getStandardHeightPixels/setStandardHeightPixels
public int getStandardHeightPixels() / public void setStandardHeightPixels(int value)
Gets or sets the default row height in this worksheet, in unit of pixels.
getStandardHeightInch/setStandardHeightInch
public double getStandardHeightInch() / public void setStandardHeightInch(double value)
Gets or sets the default row height in this worksheet, in unit of inches.
getPreserveString/setPreserveString
public boolean getPreserveString() / public void setPreserveString(boolean value)
Gets or sets a value indicating whether all worksheet values are preserved as strings.
Default is false.
getMinRow
public int getMinRow()
Minimum row index of cell which contains data or style.
getMaxRow
public int getMaxRow()
Maximum row index of cell which contains data or style.
Return -1 if there is no cell which contains data or style in the worksheet.
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).
getMaxColumn
public int getMaxColumn()
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).
Return -1 if there is no cell.
getMinDataRow
public int getMinDataRow()
Minimum row index of cell which contains data.
getMaxDataRow
public int getMaxDataRow()
Maximum row index of cell which contains data.
Return -1 if there is no cell which contains data.
getMinDataColumn
public int getMinDataColumn()
Minimum column index of cell which contains data.
-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.
getMaxDataColumn
public int getMaxDataColumn()
Maximum column index of cell which contains data.
-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.
Gets Cell item within the worksheet
The element at the specified index.NOTE: This member is now obsolete.
Instead, please use Cells.GetEnumerator() method to iterate all cells in this worksheet.
This property will be removed 12 months later since February 2015.
Aspose apologizes for any inconvenience you may have experienced.
Workbook excel = new Workbook();
Cells cells = excel.getWorksheets().get(0).getCells();
Cell cell = cells.get("A1"); //Gets the cell at "A1"
Method Detail
linkToXmlMap
public void linkToXmlMap(java.lang.String mapName, int row, int column, java.lang.String path)
throws java.lang.Exception
Link to a xml map.
e.g. A xml map element structure:
-RootElement
|-Attribute1
|-SubElement
|-Attribute2
|-Attribute3
To link "Attribute1", path is "/RootElement/Attribute1"
To link "Attribute2", path is "/RootElement/SubElement/Attribute2"
To link whole "SubElement", path is "/RootElement/SubElement"
Parameters:
mapName - name of xml map
row - row of the destination cell
column - column of the destination cell
path - path of xml element in xml map
findFormula
public CellfindFormula(java.lang.String formula, Cell previousCell)
Finds the cell with the input string.
Returns null (Nothing) if no cell is found.
NOTE: This member is now obsolete. Instead,
please use Cells.Find(object,Cell,FindOptions) method with LookInType as LookInType.OnlyFormulas
and LookAtType as LookAtType.EntireContent.
This member will be removed 12 months later since November 2018.
Aspose apologizes for any inconvenience you may have experienced.
Parameters:
formula - The formula to search for.
previousCell - Previous cell with the same formula. This parameter can be set to null if searching from the start.
Returns:
Cell object.
findFormulaContains
public CellfindFormulaContains(java.lang.String formula, Cell previousCell)
Finds the cell with formula which contains the input string.
Returns null (Nothing) if no cell is found.
NOTE: This member is now obsolete. Instead,
please use Cells.Find(object,Cell,FindOptions) method with LookInType as LookInType.OnlyFormulas
and LookAtType as LookAtType.Contains.
This member will be removed 12 months later since November 2018.
Aspose apologizes for any inconvenience you may have experienced.
Parameters:
formula - The formula to search for.
previousCell - Previous cell with the same formula. This parameter can be set to null if searching from the start.
Returns:
Cell object.
find
public Cellfind(java.lang.Object what, Cell previousCell)
Finds the cell containing with the input object.
Returns null (Nothing) if no cell is found.
Parameters:
what - The object to search for.
The type should be int,double,DateTime,string,bool.
previousCell - Previous cell with the same object.
This parameter can be set to null if searching from the start.
Returns:
Cell object.
find
public Cellfind(java.lang.Object what, Cell previousCell, FindOptions findOptions)
Finds the cell containing with the input object.
Returns null (Nothing) if no cell is found.
Parameters:
what - The object to search for.
The type should be int,double,DateTime,string,bool.
previousCell - Previous cell with the same object.
This parameter can be set to null if searching from the start.
public int importCustomObjects(java.util.Collection list, java.lang.String[] propertyNames, boolean isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, boolean insertRows, java.lang.String dateFormatString, boolean convertStringToNumber)
throws java.lang.Exception
Imports custom objects.
The custom objects should be the same type.
Parameters:
list - The custom object
propertyNames - The property names.If it is null,we will import all properties of the object.
isPropertyNameShown -
Indicates whether the property name will be imported to the first row.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
rowNumber - Number of rows to be imported.
insertRows - Indicates whether extra rows are added to fit data.
dateFormatString - Date format string for cells.
convertStringToNumber - Indicates if this method will try to convert string to number.
Returns:
Total number of rows imported.
importCustomObjects
public int importCustomObjects(java.util.Collection list, int firstRow, int firstColumn, ImportTableOptions options)
throws java.lang.Exception
Imports custom objects.
The custom objects should be the same type.
Parameters:
list - The custom object
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
Removes all formula and replaces with the value of the formula.
removeDuplicates
public void removeDuplicates()
throws java.lang.Exception
Removes duplicate rows in the sheet.
removeDuplicates
public void removeDuplicates(int startRow, int startColumn, int endRow, int endColumn)
throws java.lang.Exception
Removes duplicate values in the range.
Parameters:
startRow - The start row.
startColumn - The start column
endRow - The end row index.
endColumn - The end column index.
removeDuplicates
public void removeDuplicates(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders, int[] columnOffsets)
throws java.lang.Exception
Removes duplicate data of the range.
Parameters:
startRow - The start row.
startColumn - The start column
endRow - The end row index.
endColumn - The end column index.
hasHeaders - Indicates whether the range contains headers.
columnOffsets - The column offsets.
convertStringToNumericValue
public void convertStringToNumericValue()
Converts string data in cells to numeric value if possible.
getDependents
public com.aspose.cells.Cell[] getDependents(boolean isAll, int row, int column)
Get all cells which refer to the specific cell.
Parameters:
isAll - Indicates whether check other worksheets
row - The row index.
column - The column index.
Returns:
getDependentsInCalculation
public java.util.Iterator getDependentsInCalculation(int row, int column, boolean recursive)
Gets all cells whose calculated result depends on specific cell.
To use this method, please make sure the workbook has been set with true value for
FormulaSettings.EnableCalculationChain 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:
row - Row index of the specific cell
column - Column index of the specific cell.
recursive - Whether returns those dependents which do not reference to the specific cell directly
but reference to other leafs of that cell.
Returns:
Enumerator to enumerate all dependents(Cell objects)
public int importResultSet(java.sql.ResultSet rs, java.lang.String startCell, ImportTableOptions options)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
startCell - name of start cell to insert the resultset, such as "A1".
options - The import options
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, ImportTableOptions options)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
rowIndex - start row index in the worksheet.
columnIndex - start column index in the worksheet.
options - The import options
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
rowIndex - start row index in the worksheet.
columnIndex - start column index in the worksheet.
rowNum - number of rows to import. -1 to import all records in given resultset.
columnNum - number of columns to import. -1 to import all columns in given resultset.
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, java.lang.String startCell, int rowNum, int columnNum, boolean isFieldNameShown)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
startCell - name of start cell to insert the resultset, such as "A1".
rowNum - number of rows to import. -1 to import all records in given resultset.
columnNum - number of columns to import. -1 to import all columns in given resultset.
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
rowIndex - start row index in the worksheet.
columnIndex - start column index in the worksheet.
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, java.lang.String startCell, boolean isFieldNameShown)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
startCell - name of start cell to insert the resultset, such as "A1".
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, int rowNum, int columnNum, boolean isFieldNameShown, java.lang.String customDateFormatString, boolean convertStringToNumber)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
rowIndex - start row index in the worksheet.
columnIndex - start column index in the worksheet.
rowNum - number of rows to import. -1 to import all records in given resultset.
columnNum - number of columns to import. -1 to import all columns in given resultset.
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
customDateFormatString - Date format string for cells which contain date value.
convertStringToNumber - Indicates if this method will try to convert string to number.
Returns:
how many rows actually imported.
importResultSet
public int importResultSet(java.sql.ResultSet rs, int rowIndex, int columnIndex, boolean isFieldNameShown, java.lang.String customDateFormatString, boolean convertStringToNumber)
throws java.lang.Exception
Imports data in a ResultSet object to the worksheet.
Parameters:
rs - the ResultSet object to import from.
rowIndex - start row index in the worksheet.
columnIndex - start column index in the worksheet.
isFieldNameShown - Indicates whether the field name of the resultset will be imported to the first row.
customDateFormatString - Date format string for cells which contain date value.
convertStringToNumber - Indicates if this method will try to convert string to number.
Returns:
how many rows actually imported.
importCSV
public void importCSV(java.io.InputStream stream, TxtLoadOptions options, int firstRow, int firstColumn)
throws java.lang.Exception
Import a CSV file to the cells.
Parameters:
stream - The CSV file stream.
options - The load options for reading text file
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
merge
public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns)
Merges a specified range of cells into a single cell.
Reference the merged cell via the address of the upper-left cell in the range.
Parameters:
firstRow - First row of this range(zero based)
firstColumn - First column of this range(zero based)
totalRows - Number of rows(one based)
totalColumns - Number of columns(one based)
merge
public void merge(int firstRow, int firstColumn, int totalRows, int totalColumns, boolean mergeConflict)
Merges a specified range of cells into a single cell.
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:
firstRow - First row of this range(zero based)
firstColumn - First column of this range(zero based)
totalRows - Number of rows(one based)
totalColumns - Number of columns(one based)
mergeConflict - Merge conflict merged ranges.
merge
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.
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:
firstRow - First row of this range(zero based)
firstColumn - First column of this range(zero based)
totalRows - Number of rows(one based)
totalColumns - Number of columns(one based)
checkConflict - Indicates whether check the merged cells intersects other merged cells
mergeConflict - Merge conflict merged ranges.
unMerge
public void unMerge(int firstRow, int firstColumn, int totalRows, int totalColumns)
Unmerges a specified range of merged cells.
Parameters:
firstRow - First row of this range(zero based)
firstColumn - First column of this range(zero based)
totalRows - Number of rows(one based)
totalColumns - Number of columns(one based)
clearMergedCells
public void clearMergedCells()
Clears all merged ranges.
hideRow
public void hideRow(int row)
Hides a row.
Parameters:
row - Row index.
unhideRow
public void unhideRow(int row, double height)
Unhides a row.
Parameters:
row - Row index.
height - Row height. The row's height will be changed only when the row is hidden and given height value is positive.
hideRows
public void hideRows(int row, int totalRows)
Hides multiple rows.
Parameters:
row - The row index.
totalRows - The row number.
unhideRows
public void unhideRows(int row, int totalRows, double height)
Unhides the hidden rows.
Parameters:
row - The row index.
totalRows - The row number.
height - Row height. The row's height will be changed only when the row is hidden and given height value is positive.
setRowHeightPixel
public void setRowHeightPixel(int row, int pixels)
Sets row height in unit of pixels.
Parameters:
row - Row index.
pixels - Number of pixels.
setRowHeightInch
public void setRowHeightInch(int row, double inches)
Sets row height in unit of inches.
Parameters:
row - Row index.
inches - Number of inches. It should be between 0 and 409.5/72.
setRowHeight
public void setRowHeight(int row, double height)
Sets the height of the specified row.
Parameters:
row - Row index.
height - Height of row.In unit of point It should be between 0 and 409.5.
getRowOriginalHeightPoint
public double getRowOriginalHeightPoint(int row)
Gets original row's height in unit of point if the row is hidden
Parameters:
row - The row index.
Returns:
hideColumn
public void hideColumn(int column)
Hides a column.
Parameters:
column - Column index.
unhideColumn
public void unhideColumn(int column, double width)
Unhides a column
Parameters:
column - Column index.
width - Column width.
hideColumns
public void hideColumns(int column, int totalColumns)
Hide multiple columns.
Parameters:
column - Column index.
totalColumns - Column number.
unhideColumns
public void unhideColumns(int column, int totalColumns, double width)
Unhide multiple columns.
Only applies the column width to the hidden columns.
Parameters:
column - Column index.
totalColumns - Column number
width - Column width.
getRowHeight
public double getRowHeight(int row)
Gets the height of a specified row.
Parameters:
row - Row index
Returns:
Height of row
getViewRowHeight
public double getViewRowHeight(int row)
Gets the height of a specified row.
Parameters:
row - Row index
Returns:
Height of row
getRowHeightPixel
public int getRowHeightPixel(int row)
Gets the height of a specified row in unit of pixel.
Parameters:
row - Row index
Returns:
Height of row
getRowHeightInch
public double getRowHeightInch(int row)
Gets the height of a specified row in unit of inches.
Parameters:
row - Row index
Returns:
Height of row
getViewRowHeightInch
public double getViewRowHeightInch(int row)
Gets the height of a specified row in unit of inches.
Parameters:
row - Row index
Returns:
Height of row
setColumnWidthPixel
public void setColumnWidthPixel(int column, int pixels)
Sets column width in unit of pixels in normal view.
Parameters:
column - Column index.
pixels - Number of pixels.
setColumnWidthInch
public void setColumnWidthInch(int column, double inches)
Sets column width in unit of inches in normal view.
Parameters:
column - Column index.
inches - Number of inches.
setColumnWidth
public void setColumnWidth(int column, double width)
Sets the width of the specified column in normal view.
To hide a column, sets column width to zero.
Parameters:
column - Column index.
width - Width of column.Column width must be between 0 and 255.
getColumnWidthPixel
public int getColumnWidthPixel(int column)
Gets the width of the specified column in normal view, in units of pixel.
Parameters:
column - Column index
Returns:
Width of column in normal view.
getColumnWidthInch
public double getColumnWidthInch(int column)
Gets the width of the specified column in normal view, in units of inches.
Parameters:
column - Column index
Returns:
Width of column
getColumnWidth
public double getColumnWidth(int column)
Gets the width of the specified column in normal view
Parameters:
column - Column index
Returns:
Width of column
getViewColumnWidthPixel
public int getViewColumnWidthPixel(int column)
Get the width in different view type.
Parameters:
column - The column index.
Returns:
the column width in unit of pixels
setViewColumnWidthPixel
public void setViewColumnWidthPixel(int column, int pixels)
Sets the width of the column in different view.
If the current view type is ViewType.PAGE_LAYOUT_VIEW, the column's width is same as printed width.
Parameters:
column - The column index.
pixels - The width in unit of pixels.
getLastDataRow
public int getLastDataRow(int column)
Gets the last row index of cell which contains data in the specified column.
Parameters:
column - Column index.
Returns:
last row index.
applyColumnStyle
public void applyColumnStyle(int column, Style style, StyleFlag flag)
Applies formats for a whole column.
Parameters:
column - The column index.
style - The style object which will be applied.
flag - Flags which indicates applied formatting properties.
applyRowStyle
public void applyRowStyle(int row, Style style, StyleFlag flag)
Applies formats for a whole row.
Parameters:
row - The row index.
style - The style object which will be applied.
flag - Flags which indicates applied formatting properties.
flag - Flags which indicates applied formatting properties.
copyColumns
public void copyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber, PasteOptions pasteOptions)
throws java.lang.Exception
Copies data and formats of a whole column.
Parameters:
sourceCells0 - Source Cells object contains data and formats to copy.
public void copyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns)
throws java.lang.Exception
Copies data and formats of the whole columns.
Parameters:
sourceCells - Source Cells object contains data and formats to copy.
sourceColumnIndex - Source column index.
sourceTotalColumns - The number of the source columns.
destinationTotalColumns - The number of the destination columns.
copyRow
public void copyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)
throws java.lang.Exception
Copies data and formats of a whole row.
Parameters:
sourceCells - Source Cells object contains data and formats to copy.
sourceRowIndex - Source row index.
destinationRowIndex - Destination row index.
copyRows
public void copyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber)
throws java.lang.Exception
Copies data and formats of some whole rows.
Parameters:
sourceCells - Source Cells object contains data and formats to copy.
sourceRowIndex - Source row index.
destinationRowIndex - Destination row index.
rowNumber - The copied row number.
copyRows
public void copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions)
throws java.lang.Exception
Copies data and formats of some whole rows.
Parameters:
sourceCells0 - Source Cells object contains data and formats to copy.
sourceRowIndex - Source row index.
destinationRowIndex - Destination row index.
rowNumber - The copied row number.
copyOptions - The copy options.
copyRows
public void copyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions, PasteOptions pasteOptions)
throws java.lang.Exception
Copies data and formats of some whole rows.
Parameters:
sourceCells0 - Source Cells object contains data and formats to copy.
sourceRowIndex - Source row index.
destinationRowIndex - Destination row index.
rowNumber - The copied row number.
copyOptions - The copy options.
pasteOptions - the options of pasting.
getGroupedRowOutlineLevel
public int getGroupedRowOutlineLevel(int rowIndex)
Gets the outline level (zero-based) of the row.
If the row is not grouped, returns zero.
Parameters:
rowIndex - The row index.
Returns:
The outline level (zero-based) of the row.
getGroupedColumnOutlineLevel
public int getGroupedColumnOutlineLevel(int columnIndex)
Gets the outline level (zero-based) of the column.
If the column is not grouped, returns zero.
Parameters:
columnIndex - The column index
Returns:
The outline level of the column
getMaxGroupedColumnOutlineLevel
public int getMaxGroupedColumnOutlineLevel()
Gets the max grouped column outline level (zero-based).
Returns:
The max grouped column outline level (zero-based)
getMaxGroupedRowOutlineLevel
public int getMaxGroupedRowOutlineLevel()
Gets the max grouped row outline level (zero-based).
Returns:
The max grouped row outline level (zero-based)
showGroupDetail
public void showGroupDetail(boolean isVertical, int index)
Expands the grouped rows/columns.
Parameters:
isVertical - True, expands the grouped rows.
index - The row/column index
hideGroupDetail
public void hideGroupDetail(boolean isVertical, int index)
Collapses the grouped rows/columns.
Parameters:
isVertical - True, collapse the grouped rows.
index - The row/column index
ungroupColumns
public void ungroupColumns(int firstIndex, int lastIndex)
Ungroups columns.
Parameters:
firstIndex - The first column index to be ungrouped.
lastIndex - The last column index to be ungrouped.
groupColumns
public void groupColumns(int firstIndex, int lastIndex)
Groups columns.
Parameters:
firstIndex - The first column index to be grouped.
lastIndex - The last column index to be grouped.
groupColumns
public void groupColumns(int firstIndex, int lastIndex, boolean isHidden)
Groups columns.
Parameters:
firstIndex - The first column index to be grouped.
lastIndex - The last column index to be grouped.
isHidden - Specifies if the grouped columns are hidden.
ungroupRows
public void ungroupRows(int firstIndex, int lastIndex, boolean isAll)
Ungroups rows.
Parameters:
firstIndex - The first row index to be ungrouped.
lastIndex - The last row index to be ungrouped.
isAll - True, removes all grouped info.Otherwise, remove the outer group info.
ungroupRows
public void ungroupRows(int firstIndex, int lastIndex)
Ungroups rows.
Only removes outer group info.
Parameters:
firstIndex - The first row index to be ungrouped.
lastIndex - The last row index to be ungrouped.
groupRows
public void groupRows(int firstIndex, int lastIndex, boolean isHidden)
Groups rows.
Parameters:
firstIndex - The first row index to be grouped.
lastIndex - The last row index to be grouped.
isHidden - Specifies if the grouped columns are hidden.
groupRows
public void groupRows(int firstIndex, int lastIndex)
Groups rows.
Parameters:
firstIndex - The first row index to be grouped.
lastIndex - The last row index to be grouped.
deleteColumn
public void deleteColumn(int columnIndex, boolean updateReference)
Deletes a column.
Parameters:
columnIndex - Column index.
updateReference - Indicates if update references in other worksheets.
deleteColumn
public void deleteColumn(int columnIndex)
Deletes a column.
Parameters:
columnIndex - Column index.
deleteColumns
public void deleteColumns(int columnIndex, int totalColumns, boolean updateReference)
Deletes several columns.
Parameters:
columnIndex - Column index.
totalColumns - Number of columns to be deleted.
updateReference - Indicates if update references in other worksheets.
isDeletingRangeEnabled
public boolean isDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns)
Check whether the range could be deleted.
Parameters:
startRow - The start row index of the range.
startColumn - The start column index of the range.
totalRows - The number of the rows in the range.
totalColumns - The number of the columns in the range.
Returns:
deleteRows
public boolean deleteRows(int rowIndex, int totalRows)
Deletes several rows.
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 as MS Excel.
Parameters:
rowIndex - The first row index to be deleted.
totalRows - Number of rows to be deleted.
deleteRow
public void deleteRow(int rowIndex)
Deletes a row.
Parameters:
rowIndex - Row index.
deleteRows
public boolean deleteRows(int rowIndex, int totalRows, boolean updateReference)
Deletes multiple rows in the worksheet.
Parameters:
rowIndex - Row index.
totalRows - Number of rows to be deleted.
updateReference - Indicates if update references in other worksheets.
Returns:
deleteBlankColumns
public void deleteBlankColumns()
Delete all blank columns which do not contain any data.
deleteBlankColumns
public void deleteBlankColumns(DeleteOptions options)
Delete all blank columns which do not contain any data.
Parameters:
options - The options of deleting range.
isBlankColumn
public boolean isBlankColumn(int columnIndex)
Checks whether given column is blank(does not contain any data).
Parameters:
columnIndex - the column index
Returns:
true if given column does not contain any data
deleteBlankRows
public void deleteBlankRows()
Delete all blank rows which do not contain any data.
public void clearFormats(int startRow, int startColumn, int endRow, int endColumn)
Clears formatting of a range.
Parameters:
startRow - Start row index.
startColumn - Start column index.
endRow - End row index.
endColumn - End column index.
dispose
public void dispose()
Performs application-defined tasks associated with freeing, releasing, or
resetting unmanaged resources.
iterator
public java.util.Iterator iterator()
Gets the cells enumerator.
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).
Returns:
The cells enumerator
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());
}
Gets the Cell element at the specified cell row index and column index.
NOTE: This member is now obsolete. Instead,
please use Cells.Get(int,int) method.
This method will be removed 12 months later since JANUARY 2012.
Aspose apologizes for any inconvenience you may have experienced.
Gets the Row element or at the specified cell row index.
NOTE: This member is now obsolete. Instead,
please use RowCollection[int] method.
This method will be removed 12 months later since JANUARY 2010.
Aspose apologizes for any inconvenience you may have experienced.
Gets the Column element or at the specified cell row index.
NOTE: This member is now obsolete. Instead,
please use ColumnCollection[int] method.
This method will be removed 12 months later since JANUARY 2010.
Aspose apologizes for any inconvenience you may have experienced.
public void importTwoDimensionArray(java.lang.Object[][] objArray, int firstRow, int firstColumn)
Imports a two-dimension array of data into a worksheet.
Parameters:
objArray - Two-dimension data array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importTwoDimensionArray
public void importTwoDimensionArray(java.lang.Object[][] objArray, int firstRow, int firstColumn, boolean convertStringToNumber)
Imports a two-dimension array of data into a worksheet.
Parameters:
objArray - Two-dimension data array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
convertStringToNumber - Indicates if this method will try to convert string to number.
importTwoDimensionArray
public void importTwoDimensionArray(java.lang.Object[][] objArray, java.lang.Object[][] styles, int firstRow, int firstColumn, boolean convertStringToNumber)
Imports a two-dimension array of data into a worksheet.
Parameters:
objArray - Two-dimension data array.
styles - Two-dimension data style.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
convertStringToNumber - Indicates if this method will try to convert string to number.
importTwoDimensionArray
public void importTwoDimensionArray(java.lang.Object[][] objArray, java.lang.Object[][] styles, int firstRow, int firstColumn, TxtLoadOptions opts)
Imports a two-dimension array of data into a worksheet.
Parameters:
objArray - Two-dimension data array.
styles - Two-dimension data style.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
opts - Options for converting string values
importObjectArray
public void importObjectArray(java.lang.Object[] objArray, int firstRow, int firstColumn, boolean isVertical)
throws java.lang.Exception
Imports an array of data into a worksheet.
Parameters:
objArray - Data array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
importArrayList
public void importArrayList(java.util.ArrayList arrayList, int firstRow, int firstColumn, boolean isVertical)
throws java.lang.Exception
Imports an arraylist of data into a worksheet.
Parameters:
arrayList - Data arraylist.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
importObjectArray
public void importObjectArray(java.lang.Object[] objArray, int firstRow, int firstColumn, boolean isVertical, int skip)
Imports an array of data into a worksheet.
Parameters:
objArray - Data array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
skip - Skipped number of rows or columns.
importArray
public void importArray(java.lang.String[][] stringArray, int firstRow, int firstColumn)
throws java.lang.Exception
Imports a two-dimension array of string into a worksheet.
Parameters:
stringArray - Two-dimension string array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importFormulaArray
public void importFormulaArray(java.lang.String[] stringArray, int firstRow, int firstColumn, boolean isVertical)
Imports an array of formula into a worksheet.
Parameters:
stringArray - Formula array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
importArray
public void importArray(java.lang.String[] stringArray, int firstRow, int firstColumn, boolean isVertical)
throws java.lang.Exception
Imports an array of string into a worksheet.
Parameters:
stringArray - String array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
importArray
public void importArray(int[][] intArray, int firstRow, int firstColumn)
throws java.lang.Exception
Imports a two-dimension array of integer into a worksheet.
Parameters:
intArray - Two-dimension integer array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importArray
public void importArray(int[] intArray, int firstRow, int firstColumn, boolean isVertical)
throws java.lang.Exception
Imports an array of integer into a worksheet.
Parameters:
intArray - Integer array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
importArray
public void importArray(double[][] doubleArray, int firstRow, int firstColumn)
throws java.lang.Exception
Imports a two-dimension array of double into a worksheet.
Parameters:
doubleArray - Two-dimension double array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importArray
public void importArray(double[] doubleArray, int firstRow, int firstColumn, boolean isVertical)
throws java.lang.Exception
Imports an array of double into a worksheet.
Parameters:
doubleArray - Double array.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
isVertical - Specifies to import data vertically or horizontally.
textToColumns
public void textToColumns(int row, int column, int totalRows, TxtLoadOptions options)
throws java.lang.Exception
Splits the text in the column to columns.
Parameters:
row - The row index.
column - The column index.
totalRows - The number of rows.
options - The split options.
importCSV
public void importCSV(java.lang.String fileName, java.lang.String splitter, boolean convertNumericData, int firstRow, int firstColumn)
throws java.lang.Exception
Import a CSV file to the cells.
Parameters:
fileName - The CSV file name.
splitter - The splitter
convertNumericData - Whether the string in text file is converted to numeric data.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importCSV
public void importCSV(java.io.InputStream stream, java.lang.String splitter, boolean convertNumericData, int firstRow, int firstColumn)
throws java.lang.Exception
Import a CSV file to the cells.
Parameters:
stream - The CSV file stream.
splitter - The splitter
convertNumericData - Whether the string in text file is converted to numeric data.
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.
importCSV
public void importCSV(java.lang.String fileName, TxtLoadOptions options, int firstRow, int firstColumn)
throws java.lang.Exception
Import a CSV file to the cells.
Parameters:
fileName - The CSV file name.
options - The load options for reading text file
firstRow - The row number of the first cell to import in.
firstColumn - The column number of the first cell to import in.