public interface SSheet
Modifier and Type | Interface and Description |
---|---|
static class |
SSheet.SheetVisible |
Modifier and Type | Method and Description |
---|---|
SChart |
addChart(SChart.ChartType type,
ViewAnchor anchor) |
SDataValidation |
addDataValidation(CellRegion region) |
SDataValidation |
addDataValidation(CellRegion region,
SDataValidation src) |
void |
addMergedRegion(CellRegion region)
Add a merged area, you can't assign a area that overlaps existed merged area.
|
SPicture |
addPicture(int index,
ViewAnchor anchor)
Add a picture into the sheet with known picture data index.
|
SPicture |
addPicture(SPicture.Format format,
byte[] data,
ViewAnchor anchor)
Add a picture into this sheet with raw picture data and format.
|
void |
addTable(STable table)
Add a new table
|
void |
clearAutoFilter()
Clear auto filter if there is.
|
void |
clearCell(CellRegion region)
Clear cells in specified region
|
void |
clearCell(int rowIdx,
int columnIdx,
int lastRowIdx,
int lastColumnIdx) |
SAutoFilter |
createAutoFilter(CellRegion region)
Creates a new auto filter, the old one will be drop directly.
|
void |
deleteAutoFilter()
Delete current autofilter if it has
|
void |
deleteCell(CellRegion region,
boolean horizontal)
Delete a region of cells and shift existing cells.
|
void |
deleteCell(int rowIdx,
int columnIdx,
int lastRowIndex,
int lastColumnIndex,
boolean horizontal) |
void |
deleteChart(SChart chart) |
void |
deleteColumn(int columnIdx,
int lastColumnIdx)
delete columns specified by first and last index
|
void |
deleteDataValidation(SDataValidation validation) |
List<SDataValidation> |
deleteDataValidationRegion(CellRegion region)
Delete data validations that are covered by the specified region.
|
void |
deletePicture(SPicture picture) |
void |
deleteRow(int rowIdx,
int lastRowIdx)
delete rows specified by first and last index
|
Object |
getAttribute(String name)
Get the runtime custom attribute that stored in this sheet
|
Map<String,Object> |
getAttributes()
Get the unmodifiable runtime attributes map
|
SAutoFilter |
getAutoFilter()
Gets the auto filter information if there is.
|
SBook |
getBook()
Get the owner book
|
SCell |
getCell(int rowIdx,
int columnIdx)
This method always returns not-null cell object.
|
SCell |
getCell(String cellRefString) |
Iterator<SCell> |
getCellIterator(int row) |
SChart |
getChart(int idx) |
SChart |
getChart(String chartid) |
List<SChart> |
getCharts() |
SColumn |
getColumn(int columnIdx) |
SColumnArray |
getColumnArray(int columnIdx) |
Iterator<SColumnArray> |
getColumnArrayIterator() |
Iterator<SColumn> |
getColumnIterator() |
List<SConditionalFormatting> |
getConditionalFormattings()
Returns the conditional formatting applied to this sheet.
|
List<CellRegion> |
getContainsMergedRegions(CellRegion region)
Get the merged region that are contained by region.
|
CellRegion |
getDataRegion()
Returns the region which contains data(including chart, picture, and
fills) in this sheet; return null if empty sheet.
|
SDataValidation |
getDataValidation(int idx) |
SDataValidation |
getDataValidation(int row,
int column) |
SDataValidation |
getDataValidation(String id) |
List<SDataValidation> |
getDataValidations() |
int |
getDefaultColumnWidth() |
int |
getDefaultRowHeight() |
int |
getEndCellIndex(int rowIdx) |
int |
getEndColumnIndex() |
int |
getEndRowIndex() |
short |
getHashedPassword()
Internal Use only.
|
String |
getId() |
CellRegion |
getMergedRegion(int idx) |
CellRegion |
getMergedRegion(int row,
int column) |
CellRegion |
getMergedRegion(String cellRefString) |
List<CellRegion> |
getMergedRegions() |
int |
getNumOfChart() |
int |
getNumOfDataValidation() |
int |
getNumOfMergedRegion() |
int |
getNumOfPicture() |
List<CellRegion> |
getOverlapsMergedRegions(CellRegion region,
boolean excludeContains)
Get the merged region that overlapped the region
|
SPicture |
getPicture(int idx) |
SPicture |
getPicture(String picid) |
List<SPicture> |
getPictures() |
SPrintSetup |
getPrintSetup() |
SRow |
getRow(int rowIdx) |
Iterator<SRow> |
getRowIterator() |
Iterator<SRow> |
getRowIterator(int start,
int end) |
String |
getSheetName()
Get the sheet name
|
SSheetProtection |
getSheetProtection()
Gets enhanced protection.
|
SSheet.SheetVisible |
getSheetVisible()
Get the sheet current visible state.
|
int |
getStartCellIndex(int rowIdx) |
int |
getStartColumnIndex() |
int |
getStartRowIndex() |
List<STable> |
getTables()
Get tables in this sheet
|
SSheetViewInfo |
getViewInfo() |
void |
insertCell(CellRegion region,
boolean horizontal)
Insert a region of cells and shift existing cells.
|
void |
insertCell(int rowIdx,
int columnIdx,
int lastRowIndex,
int lastColumnIndex,
boolean horizontal) |
void |
insertColumn(int columnIdx,
int lastColumnIdx)
insert columns specified by first and last index
|
void |
insertRow(int rowIdx,
int lastRowIdx)
insert rows specified by first and last index
|
boolean |
isProtected()
Check if the sheet is protected
|
void |
moveCell(CellRegion region,
int rowOffset,
int columnOffset)
Move one or more cells.
|
void |
moveCell(int rowIdx,
int columnIdx,
int lastRowIdx,
int lastColumnIdx,
int rowOffset,
int columnOffset)
Move a region of cells specified by 4 indexes.
|
CellRegion |
pasteCell(SheetRegion src,
CellRegion dest,
PasteOption option)
paste cell from src sheet to this sheet, the sheets must in same book
|
void |
removeDataValidationRegion(CellRegion region)
Deprecated.
|
void |
removeMergedRegion(CellRegion region,
boolean removeOverlaps)
Remove the merged area that are contained by region
|
void |
removeTable(String tableName)
Remove the table of the specified table name.
|
void |
setAlgName(String algName)
New way of hashing sheet protection password.
|
Object |
setAttribute(String name,
Object value)
Set the runtime custom attribute to stored in this sheet, the attribute is only use for developer to stored runtime data in the sheet,
values will not stored to excel when exporting.
|
void |
setDefaultColumnWidth(int width)
set default column width in pixels
|
void |
setDefaultRowHeight(int height)
set default row height in pixels
|
void |
setHashedPassword(short hashpass)
Internal User only.
|
void |
setHashValue(String hashValue)
New way of hashing sheet protection password.
|
void |
setPassword(String password)
Sets password to protect sheet, set null to unprotect it.
|
void |
setSaltValue(String saltValue)
New way of hashing sheet protection password.
|
void |
setSheetVisible(SSheet.SheetVisible state)
Set the sheet current visible state.
|
void |
setSpinCount(String spinCount)
New way of hashing sheet protection password.
|
SColumnArray |
setupColumnArray(int colunmIdx,
int lastColumnIdx)
Set up a column array, if one array range overlaps another, it throws IllegalStateException.
|
SBook getBook()
String getSheetName()
Iterator<SRow> getRowIterator()
Iterator<SRow> getRowIterator(int start, int end)
start
- the start indexend
- then end indexIterator<SColumn> getColumnIterator()
Iterator<SColumnArray> getColumnArrayIterator()
SColumnArray setupColumnArray(int colunmIdx, int lastColumnIdx)
colunmIdx
- index of the starting columnlastColumnIdx
- index of the end columnint getDefaultRowHeight()
int getDefaultColumnWidth()
void setDefaultRowHeight(int height)
void setDefaultColumnWidth(int width)
SRow getRow(int rowIdx)
SColumnArray getColumnArray(int columnIdx)
setupColumnArray(int, int)
SColumn getColumn(int columnIdx)
SCell getCell(int rowIdx, int columnIdx)
SCell.isNull()
to know it's null (blank) or not.SCell getCell(String cellRefString)
getCell(int, int)
String getId()
SSheetViewInfo getViewInfo()
SPrintSetup getPrintSetup()
int getStartRowIndex()
int getEndRowIndex()
int getStartColumnIndex()
int getEndColumnIndex()
int getStartCellIndex(int rowIdx)
int getEndCellIndex(int rowIdx)
void clearCell(int rowIdx, int columnIdx, int lastRowIdx, int lastColumnIdx)
clearCell(CellRegion)
void clearCell(CellRegion region)
void moveCell(int rowIdx, int columnIdx, int lastRowIdx, int lastColumnIdx, int rowOffset, int columnOffset)
moveCell(CellRegion, int, int)
void moveCell(CellRegion region, int rowOffset, int columnOffset)
region
- the region of cells to moverowOffset
- positive number to move down, negative to move upcolumnOffset
- positive number to move right, negative to move leftvoid insertRow(int rowIdx, int lastRowIdx)
void deleteRow(int rowIdx, int lastRowIdx)
void insertColumn(int columnIdx, int lastColumnIdx)
void deleteColumn(int columnIdx, int lastColumnIdx)
void insertCell(int rowIdx, int columnIdx, int lastRowIndex, int lastColumnIndex, boolean horizontal)
insertCell(CellRegion, boolean)
void insertCell(CellRegion region, boolean horizontal)
region
- the region of cells to inserthorizontal
- TRUE for shifting right, FALSE for shifting downvoid deleteCell(CellRegion region, boolean horizontal)
region
- the region of cells to deletehorizontal
- TRUE for shifting left, FALSE for shifting upvoid deleteCell(int rowIdx, int columnIdx, int lastRowIndex, int lastColumnIndex, boolean horizontal)
deleteCell(CellRegion, boolean)
SPicture addPicture(SPicture.Format format, byte[] data, ViewAnchor anchor)
format
- picture format as specified in SPicture.Format
data
- raw byte data of the pictureanchor
- where to anchor this pictureSPicture
SPicture addPicture(int index, ViewAnchor anchor)
index
- SPictureData
indexanchor
- where to anchor this pictureSPicture
addedvoid deletePicture(SPicture picture)
int getNumOfPicture()
SPicture getPicture(int idx)
SChart addChart(SChart.ChartType type, ViewAnchor anchor)
void deleteChart(SChart chart)
int getNumOfChart()
SChart getChart(int idx)
List<CellRegion> getMergedRegions()
void removeMergedRegion(CellRegion region, boolean removeOverlaps)
region
- removeOverlpas
- true if you want to remove the merged areas that are just overlapped.void addMergedRegion(CellRegion region)
region
- int getNumOfMergedRegion()
CellRegion getMergedRegion(int idx)
List<CellRegion> getOverlapsMergedRegions(CellRegion region, boolean excludeContains)
List<CellRegion> getContainsMergedRegions(CellRegion region)
CellRegion getMergedRegion(int row, int column)
CellRegion getMergedRegion(String cellRefString)
SDataValidation addDataValidation(CellRegion region)
SDataValidation addDataValidation(CellRegion region, SDataValidation src)
SDataValidation getDataValidation(String id)
void deleteDataValidation(SDataValidation validation)
int getNumOfDataValidation()
SDataValidation getDataValidation(int idx)
List<SDataValidation> getDataValidations()
@Deprecated void removeDataValidationRegion(CellRegion region)
List<SDataValidation> deleteDataValidationRegion(CellRegion region)
region
- the cover regionSDataValidation getDataValidation(int row, int column)
row
- column
- Object getAttribute(String name)
name
- the attribute nameObject setAttribute(String name, Object value)
name
- name the attribute namevalue
- the attribute valueMap<String,Object> getAttributes()
boolean isProtected()
void setPassword(String password)
protection
- short getHashedPassword()
void setHashedPassword(short hashpass)
SAutoFilter getAutoFilter()
SAutoFilter createAutoFilter(CellRegion region)
region
- the auto filter regionvoid deleteAutoFilter()
void clearAutoFilter()
CellRegion pasteCell(SheetRegion src, CellRegion dest, PasteOption option)
src
- src sheet and it's region to pastedest
- destination region in this sheetoption
- the copy optionSSheetProtection getSheetProtection()
SSheet.SheetVisible getSheetVisible()
void setSheetVisible(SSheet.SheetVisible state)
void addTable(STable table)
table
- void removeTable(String tableName)
tableName
- void setHashValue(String hashValue)
hashValue
- void setSpinCount(String spinCount)
spinCount
- void setSaltValue(String saltValue)
saltValue
- void setAlgName(String algName)
algName
- List<SConditionalFormatting> getConditionalFormattings()
CellRegion getDataRegion()
Copyright © 2020. All rights reserved.