public class WorkBook
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
bookProtectStructure
book protection structure
|
static int |
bookProtectWindow
book protection window
|
static int |
CopyAll
all are copied
|
static int |
CopyFormats
formats be copied
|
static int |
CopyFormulas
formulas be copied
|
static int |
CopyValues
values be copied
|
static short |
SheetNormalView
sheet page layout normal
|
static short |
SheetPageBreakPreView
sheet page layout in break preview mode
|
static short |
SheetPageLayoutView
sheet page layout in page mode
|
static int |
sheetProtectionAllowChangeLocked
sheet protection allow change locked
|
static int |
sheetProtectionAllowChangeUnlocked
sheet protection allow change unlocked
|
static int |
sheetProtectionAllowDefault
sheet protection allow default options
|
static int |
sheetProtectionAllowDeleteColumns
sheet protection allow delete cols
|
static int |
sheetProtectionAllowDeleteRows
sheet protection allow delete rows
|
static int |
sheetProtectionAllowEditObjects
sheet protection allow edit object
|
static int |
sheetProtectionAllowEditScenarios
sheet protection allow edit scenarios
|
static int |
sheetProtectionAllowEverything
sheet protection allow everything
|
static int |
sheetProtectionAllowFormatCells
sheet protection allow format cells
|
static int |
sheetProtectionAllowFormatColumns
sheet protection allow format columns
|
static int |
sheetProtectionAllowFormatRows
sheet protection allow format rows
|
static int |
sheetProtectionAllowInsertColumns
sheet protection allow insert columns
|
static int |
sheetProtectionAllowInsertHyperlinks
sheet protection allow insert hyperlink
|
static int |
sheetProtectionAllowInsertRows
sheet protection allow insert rows
|
static int |
sheetProtectionAllowLockedEditFocus
sheet protection allow locked edit focus
|
static int |
sheetProtectionAllowLockedInCellEdit
sheet protection allow locked in cell edit
|
static int |
sheetProtectionAllowNone
sheet protection none
|
static int |
sheetProtectionAllowSelectLocked
sheet protection allow selected locked
|
static int |
sheetProtectionAllowSelectUnlocked
sheet protection allow select unlocked
|
static int |
sheetProtectionAllowSort
sheet protection allow sort
|
static int |
sheetProtectionAllowUseAutoFilter
sheet protection allow use autofilter
|
static int |
sheetProtectionAllowUseOutlining
sheet protection allow use outlining
|
static int |
sheetProtectionAllowUsePivotRanges
sheet protection allow use pivot ranges
|
static short |
SheetStateHidden
sheet hidden
|
static short |
SheetStateShown
sheet shown normally
|
static short |
SheetStateVeryHidden
sheet hidden and can't be unhide from UI
|
static short |
ShiftColumns
cell/range shift direction,cols
|
static short |
ShiftHorizontal
cell/range shift direction,horizontal
|
static short |
ShiftRows
cell/range shift direction,rows
|
static short |
ShiftVertical
cell/range shift direction,vertical
|
static short |
ShowAutomatic
scrollbar shown automatically
|
static short |
ShowOff
scrollbar not shown
|
static short |
ShowOn
scrollbar shown always
|
static short |
TabsBottom
sheets tab shown on bottom
|
static short |
TabsOff
sheets tab not shown
|
static short |
TabsTop
sheets tab shown on top
|
static short |
TypeEmpty
cell type empty
|
static short |
TypeError
cell type error,negative if formula cell
|
static short |
TypeLogical
cell type logic,negative if formula cell
|
static short |
TypeNumber
cell type number,negative if formula cell
|
static short |
TypeText
cell type text,negative if formula cell
|
Constructor and Description |
---|
WorkBook()
default constructor
|
Modifier and Type | Method and Description |
---|---|
AutoShape |
addAutoShape(double x1,
double y1,
double x2,
double y2,
short type)
Creates and adds a AutoShape to the active worksheet.
|
ChartShape |
addChart(double x1,
double y1,
double x2,
double y2)
Creates and adds a chart to the active worksheet.
|
ChartShape |
addChartSheet(int sheetIndex)
Creates and adds a chart to the book and make it a chart sheet.
|
void |
addColPageBreak(int col)
Adds a vertical page break to the left edge of the specified column.
|
void |
addComment(int row1,
int col1,
java.lang.String text,
java.lang.String author)
add a comment to the cell in the current sheet
|
FormControlShape |
addFormControl(double x1,
double y1,
double x2,
double y2,
int type)
Creates and adds a FormControl to the active worksheet.
|
HyperLink |
addHyperlink(int row1,
int col1,
int row2,
int col2,
java.lang.String url,
int type,
java.lang.String tooltip)
Adds a hyperlink to the range in the current worksheet.
|
PictureShape |
addPicture(double x1,
double y1,
double x2,
double y2,
byte[] picData)
Adds a picture object to the worksheet
|
PictureShape |
addPicture(double x1,
double y1,
double x2,
double y2,
java.lang.String filename)
Adds a picture object to the worksheet
|
BookPivotRange |
addPivotRange(com.smartxls.data.SXQuery query,
int dstSheet,
int dstRow1,
int dstCol1)
create new pivot table range with external data source and dest location
|
BookPivotRange |
addPivotRange(int srcSheet,
int srcRow1,
int srcCol1,
int srcRow2,
int srcCol2,
int dstSheet,
int dstRow1,
int dstCol1)
create new pivot table range with source link range and dest location
|
BookPivotRange |
addPivotRange(java.lang.String linkRange,
java.lang.String destRange)
create new pivot table range with external data source and dest location
|
void |
addRowPageBreak(int row)
Adds a horizontal page break adjacent to the top edge of the specified row.
|
Table |
addTable(java.lang.String tableName,
int row1,
int col1,
int row2,
int col2,
TableBuiltInStyles builtInTableStyle)
add the table object to current selected sheet
|
void |
autoFilter()
Creates an AutoFilter using this range to identify the bounds.
|
void |
clearCell(int row,
int col)
set cell value to empty,do nothing if cell is null
|
void |
clearRange(int row1,
int col1,
int row2,
int col2)
Clears the specified range.
|
void |
copyAllBookFrom(WorkBook wb) |
void |
copyChartTo(ChartShape chartShape,
int x1,
int y1,
int x2,
int y2)
this will copy chart shape and move to new location
|
void |
copyRange(int dstRow1,
int dstCol1,
int dstRow2,
int dstCol2,
int srcRow1,
int srcCol1,
int srcRow2,
int srcCol2)
Copies a range of cells to a new location in the current workbook.
|
void |
copyRange(int dstSheet,
int dstRow1,
int dstCol1,
int dstRow2,
int dstCol2,
WorkBook book,
int srcSheet,
int srcRow1,
int srcCol1,
int srcRow2,
int srcCol2)
Copies a range of cells to a new location in the current workbook.
|
void |
copyRange(int dstSheet,
int dstRow1,
int dstCol1,
int dstRow2,
int dstCol2,
WorkBook book,
int srcSheet,
int srcRow1,
int srcCol1,
int srcRow2,
int srcCol2,
int what)
Copies a range of cells to a new location in the current workbook.
|
void |
copyRange(int dstRow1,
int dstCol1,
int dstRow2,
int dstCol2,
WorkBook book,
int srcRow1,
int srcCol1,
int srcRow2,
int srcCol2)
Copies a range of cells to a new location in the current workbook.
|
void |
copySheet(int insertAt)
Creates copies of the selected sheet.
|
void |
CopySheetFromBook(WorkBook m_SrcBook,
int srcSheetIndex,
int destSheetIndex)
copy the sheet from specified Book View to specified sheet.
|
ConditionFormat |
CreateConditionFormat()
Creates a new instance of a conditional format in current selected sheet.
|
DataValidation |
CreateDataValidation()
Creates a new instance of a data validation object in current selected sheet.
|
void |
CreateTableStyle(java.lang.String tableStyleName,
java.util.HashMap<com.smartxls.enums.TableStyleElementType,RangeStyle> tableStyleElements)
add new tablestyle to the workbook
|
void |
deleteDefinedName(java.lang.String name)
remove the defined name
|
void |
deleteRange(int row1,
int col1,
int row2,
int col2,
short shift)
Deletes cells, rows, or columns from the specified selected sheets.
|
void |
deleteRange(int row1,
int col1,
int row2,
int col2,
short shift,
boolean bFixformulas)
Deletes cells, rows, or columns from the specified selected sheets.
|
void |
deleteSheets(int sheet,
int sheets)
Deletes one or more worksheets from a workbook.
|
void |
dispose()
desconstructor of the workbook
|
void |
editCopyDown()
Copies cells in the top row of a selection to the other rows in the selected range and adjusts relative cell references appropriately.
|
void |
editCopyRight()
Copies cells in the left column of a selection to the other columns in the selected range and adjusts relative cell references appropriately.
|
void |
exportPDF(java.io.OutputStream outputstream)
export current sheet to the outputstream with pdf format
|
void |
exportPDF(java.io.OutputStream outputstream,
java.util.Map fontEncodeMap,
boolean sheetOnly)
export current sheet to pdf
|
void |
exportPDF(java.lang.String fileName)
export current sheet to pdf file
|
void |
exportPDF(java.lang.String fileName,
java.util.Map fontEncodeMap,
boolean sheetOnly)
export current sheet to pdf file
|
RangeArea |
find(int row1,
int col1,
java.lang.String text)
find the first cell which match the search string from the specified cell.
|
RangeArea |
find(int row1,
int col1,
java.lang.String text,
boolean matchCase,
boolean matchEntire,
boolean inFormula)
find the first cell which match the search string from the specified cell.
|
int |
findSheetByName(java.lang.String sheetName)
find the sheet index number by the sheet name.
|
java.lang.String |
formatRCNr(int row,
int col,
boolean doAbsolute)
Returns a string containing a formatted row and column reference.
|
void |
freezePanes(int topRow,
int leftCol,
int splitRows,
int splitCols,
boolean splitView)
Sets frozen panes at the specified position.
|
int |
getActiveCol()
return the col index of the active cell
|
BookPivotRange |
getActivePivotRange(int activeRow1,
int activeCol1)
return the pivot table if the active cell is in
|
int |
getActiveRow()
return the row index of the active cell
|
AutoFilter |
getAutoFilter() |
int |
getBookProtection()
Return the flags indicating what are protected on this workbook when protection is enabled.
|
BuiltInDocumentProperties |
getBuiltInDocumentProperties()
build in document properties
|
ChartShape |
getChart(int index)
Returns the first chart in the active worksheet.
|
int |
getChartCount()
get the picture numbers in the current sheet
|
int |
getColOutlineLevel(int col)
Returns the outline level of a single specified column.
|
int[] |
getColPageBreaks()
return all col index which has page break
|
int |
getColWidth(int col)
Returns the width of a single column.
|
CommentShape |
getComment(int index)
Returns the specified comment in the active worksheet.
|
CommentShape |
getComment(int row1,
int col1)
get the comment from the specified cell
|
int |
getCommentCount()
Returns the Comment count in the active worksheet.
|
RangeStyle |
getConditionalFormatAppliedCellStyle(int sheet1,
int row1,
int col1)
Returns the RangeStyle of the specified cell with conditional format applied
|
ConditionFormat[] |
getConditionalFormats()
Returns the conditional formats for the current selection.
|
char |
getCSVSeparator()
get the csv seprator char
|
CustomDocumentProperties |
getCustomDocumentProperties()
custom document properties
|
int |
getDefaultColWidth()
Returns the default column width of the worksheet.
|
int |
getDefaultRowHeight()
Returns the default row height of the worksheet.
|
java.lang.String |
getDefinedName(int name)
Returns the defined name for the specified index number.
|
java.lang.String |
getDefinedName(java.lang.String name)
Returns the definition associated with the specified name.
|
int |
getDefinedNameCount()
Returns the number of defined names
|
java.lang.String |
getFormattedText(int row,
int col)
Returns the formatted text value of the specified cell.
|
java.lang.String |
getFormattedText(int sheet,
int row,
int col)
Returns the formatted text value of the specified cell.
|
FormControlShape |
getFormControl(int type,
int index)
get the specified index formcontrol from the current sheet
|
java.lang.String |
getFormula(int row,
int col)
Returns the text of the formula of the specified cell
|
java.lang.String |
getFormula(int sheet,
int row,
int col)
Returns the text of the formula of the specified cell in current selected sheets.
|
RangeArea |
getFormulaRange(java.lang.String formula)
formula string to rangearea object
|
int |
getHiddenState()
Returns the hidden state for the sheet.
|
HyperLink |
getHyperlink(int index)
get the specified index hyperlink object from current sheet
|
HyperLink |
getHyperlink(int row,
int col)
get the specified index hyperlink object from current sheet
|
HyperLink[] |
getHyperlinks() |
int |
getIterationMax()
Returns the maximum number of calculation iterations.
|
double |
getIterationMaxChange()
Returns the maximum iteration change value.
|
int |
getLastCol()
Returns the number of the last occupied column.
|
int |
getLastColForRow(int row)
Returns the number of the last occupied column in the specified row.
|
int |
getLastRow()
Returns the number of the last row that is not empty, including cells that contain only formatting.
|
void |
getLock()
Acquire a lock for the group.
|
RangeArea[] |
getMergedRanges()
return the list merged range from the current selected worksheet
|
double |
getNumber(int row,
int col)
Returns the numeric value of the specified cell.
|
double |
getNumber(int sheet,
int row,
int col)
Returns the numeric value of the specified cell in the specified worksheet.
|
double |
getNumber(java.lang.String name)
Returns the numeric value of the specified cell.
|
int |
getNumSheets()
Returns the number of worksheets in the current workbook.
|
int |
getPaletteEntry(int entry)
Returns a color in the color palette.
|
int |
getPictureCount()
get the picture numbers in the current sheet
|
PictureShape |
getPictureShape(int index)
Returns the specified index picture from the active worksheet.
|
BookPivotRangeModel |
getPivotModel()
Deprecated.
relaced by workbook.addPivotRange(...) and workbook.getActivePivotRange(...)
|
java.lang.String |
getPrintArea()
Returns the current print area.
|
double |
getPrintBottomMargin()
Returns the bottom print margin in inches.
|
java.lang.String |
getPrintFooter()
Returns the current page footer.
|
double |
getPrintFooterMargin()
Returns the page footer margin
|
java.lang.String |
getPrintHeader()
Returns the page header printed at the top of each page.
|
double |
getPrintHeaderMargin()
Returns the page header margin used during printing.
|
double |
getPrintLeftMargin()
Returns the left print margin in inches.
|
int |
getPrintNumberOfCopies()
Returns the number copies to print
|
int |
getPrintPaperHeight()
Returns the height of the paper in twips.
|
short |
getPrintPaperSize()
Returns paper size print setting value.
|
int |
getPrintPaperWidth()
Returns the width of the paper in twips.
|
double |
getPrintRightMargin()
Returns the right print margin in inches.
|
int |
getPrintScale()
Returns the scale factor for the current worksheet.
|
int |
getPrintScaleFitHPages()
Returns the number of horizontal pages to which the print job is fit.
|
int |
getPrintScaleFitVPages()
Returns the number of vertical pages to which the print job is fit.
|
int |
getPrintStartPageNumber()
Returns the number displayed on the first page printed.
|
java.lang.String |
getPrintTitles()
Returns the print titles to be printed at the top of each page
|
double |
getPrintTopMargin()
Returns the top print margin in inches.
|
RangeStyle |
getRangeStyle()
Returns the format of the selected range of cells.
|
RangeStyle |
getRangeStyle(int row1,
int col1,
int row2,
int col2)
Returns the RangeStyle of the specified range of cells
|
int |
getRowHeight(int row)
Returns the height of a single specified row.
|
int |
getRowOutlineLevel(int row)
Returns the outline level of a single specified row.
|
int[] |
getRowPageBreaks()
return all row index which has page break
|
RangeArea |
getSelection()
return the current selected range
|
int |
getSheet()
Returns the current selected worksheet index.
|
java.lang.String |
getSheetName(int sheet)
Returns the name of the specified worksheet.
|
java.lang.Object |
getSheetProperty(SheetVarType varType)
access the sheet internal property by the variant type
|
int |
getSheetProtection(int sheet)
Returns the flags indicating what are allowed when sheet protection is enabled.
|
int |
getSheetTabColor()
return the color used by the sheet tab
|
int |
getSheetViewType()
Returns the sheet view type.
|
short |
getShowHScrollBar()
Returns the mode for the horizontal scroll bar.
|
short |
getShowTabs()
Returns the display status and position of the sheet name tabs on a workbook.
|
short |
getShowVScrollBar()
Returns the mode for the vertical scroll bar.
|
Table |
getTable(int row1,
int col1)
return the table if the active cell is in
|
java.lang.String |
getText(int row,
int col)
Returns the text value of the specified cell.
|
java.lang.String |
getText(int row,
int col,
boolean calc)
Returns the text value of the specified cell.
|
java.lang.String |
getText(int sheet,
int row,
int col)
c
Returns the text value of the specified cell.
|
java.lang.String |
getText(java.lang.String name)
return the text value of the specified named cell
|
short |
getType()
Returns the cell type of the active cell.
|
short |
getType(int row,
int col)
Returns the cell type of the specified cell.
|
short |
getType(int sheet,
int row,
int col)
Returns the cell type of the specified cell.
|
DataValidation |
getValidation(int row1,
int col1)
get the validation object from specified cell
|
java.lang.String |
getVersionString()
Returns the version of this component in a string.
|
int |
getViewScale()
Returns the current display scale for a workbook.
|
ExcelVersion |
getWorkBookVersion() |
boolean |
hasAutoFilter() |
void |
insertRange(int row1,
int col1,
int row2,
int col2,
short shift)
insert new cells, rows or columns
|
void |
insertSheets(int sheet,
int sheets)
Inserts one or more worksheets at the specified location.
|
boolean |
isArrayFormula(int row,
int col)
return true if the cell is array formula
|
boolean |
isBookProtected() |
boolean |
isCalcOnSave()
sheet calculated on save setting
|
boolean |
isColHidden(int col)
Returns true if the column is hidden.
|
boolean |
isIterationEnabled()
Returns true if iteration is enabled.
|
boolean |
isPrintAutoPageNumbering()
Returns true if automatic page numbering is enabled.
|
boolean |
isPrintGridLines()
Returns true if grid lines are printed for the current sheet.
|
boolean |
isPrintHCenter()
Returns whether the current sheet is centered horizontally when printed.
|
boolean |
isPrintHFAlignMargin() |
boolean |
isPrintHFScaleDoc() |
boolean |
isPrintLandscape()
Returns true if the workbook is printed with a landscape orientation.
|
boolean |
isPrintLeftToRight()
Returns whether the current sheet is printed left to right then top to bottom, or top to bottom then left to right.
|
boolean |
isPrintNoColor()
Returns true if all workbook colors are converted to black and white, and all patterns are removed when printing.
|
boolean |
isPrintRowColHeading()
Returns whether row/col headings are printed for the current sheet.
|
boolean |
isPrintScaleFitToPage()
Returns true if the workbook is printed on the number of vertical and horizontal pages returned by the
setPrintScaleFitToPage(boolean) method. |
boolean |
isPrintVCenter()
Returns true if the current sheet is centered vertically when printed.
|
boolean |
isRowHeightAutoSize(int row)
Returns true if row height is determined automatically.
|
boolean |
isRowHidden(int row)
Returns true if row is hidden.
|
boolean |
isSheetProtected(int sheet)
Returns true if protection is enabled for the specified sheet.
|
boolean |
isSheetRightToLeft()
sheet right to left setting
|
boolean |
isShowGridLines()
Returns true if grid lines are shown.
|
boolean |
isShowRowColHeader()
Returns true if row/col headers are shown.
|
boolean |
isShowZeroValues()
Returns true if cells with zero values are displayed.
|
boolean |
isSummaryColsBeforeDetail()
Returns true if col outline summaries are before col detail information.
|
boolean |
isSummaryRowsBeforeDetail()
Returns true if row outline summaries are before row detail information.
|
void |
moveSheet(int insertAt)
Moves selected sheet to a specified location.
|
void |
print()
Prints the selected worksheet.
|
void |
print(java.awt.print.PrinterJob printJob,
javax.print.attribute.PrintRequestAttributeSet printrequestattributeset)
Prints the selected worksheet to the passed-in Printer Job.
|
void |
quitGroup()
quit this workbook from group
|
void |
read(java.io.InputStream inputstream)
Reads workbook from the specified input stream.
|
void |
read(java.io.InputStream inputstream,
java.lang.String password)
Reads workbook from the specified input stream.
|
void |
read(java.lang.String fileName)
Reads workbook from the specified file.
|
void |
read(java.lang.String fileName,
java.lang.String password)
Reads workbook from the specified file.
|
void |
readCSV(java.lang.String fileName)
load csv content from csv file
|
void |
readXLSB(java.io.InputStream in)
Reads workbook from Excel2007+ xlsb file inputstream.
|
void |
readXLSB(java.io.InputStream in,
java.lang.String pass)
reads workbook with xlsb format
|
void |
readXLSB(java.lang.String filename)
Reads workbook from xlsb file.
|
void |
readXLSB(java.lang.String filename,
java.lang.String pass)
Reads workbook from xlsb file.
|
void |
readXLSX(java.io.InputStream in)
Reads a worksheet or workbook from Excel2003 spreadsheetxml inputstream.
|
void |
readXLSX(java.io.InputStream stream,
java.lang.String password)
reads workbook with xlsx format
|
void |
readXLSX(java.lang.String filename)
Reads a worksheet or workbook from excel xlsx file.
|
void |
readXLSX(java.lang.String filename,
java.lang.String password)
reads workbook
|
void |
readXML(java.io.InputStream in)
Reads a worksheet or workbook from excel xlsx inputstream.
|
void |
recalc()
Recalculate the workbook
|
void |
releaseLock()
Release the lock previously acquired with getLock
|
void |
removeChart(int index)
remove specified index chart from current sheet
|
void |
removeColPageBreak(int col)
Removes a vertical page break adjacent to the left edge of the specified column.
|
void |
removeComment(CommentShape comment)
remove the specified comment from the current sheet
|
void |
removeFormControl(int type,
int index)
remove the specified index formcontrol from the current sheet
|
void |
removeHyperlink(HyperLink hyperlink)
remove the specified hyperlink object
|
void |
removePicture(int index)
remove specified index image from current sheet
|
void |
removeRowPageBreak(int row)
Removes a horizontal page break adjacent to the current cell.
|
void |
replace(int row1,
int col1,
int row2,
int col2,
java.lang.String find,
java.lang.String replace) |
void |
replace(java.lang.String find,
java.lang.String replace)
find all the range cells with specified search string in current selected sheet,replace with the other string.
|
void |
replace(java.lang.String find,
java.lang.String replace,
boolean matchEntire)
find all the range cells with specified search string in current selected sheet,replace with the other string.
|
void |
resetRowInfo(int row1,
int row2)
reset the row info to default
|
void |
setActiveCell(int row,
int col)
Sets the row and column coordinates of the active cell.
|
void |
setArrayFormula(int row,
int col,
int row2,
int col2,
java.lang.String formula)
Sets the array formula for the specified range.
|
void |
setAutoRecalc(boolean auto)
enable/disable auto recalc flag
|
void |
setBookProtection(boolean bProtected,
int protect,
java.lang.String password)
Sets whether protection is enabled for this workbook.
|
void |
setCalcOnSave(boolean flag)
sheet calculated on save setting
|
void |
setColHidden(int col,
boolean colHidden)
Sets a flag indicating whether or not the specified column is hidden.
|
void |
setColOutlineLevel(int col1,
int col2,
int outlineLevel,
boolean additive)
Sets the outline level of a range of columns.
|
void |
setColWidth(int col,
int width)
Sets the width of a single column.
|
void |
setColWidthAutoSize(int col,
boolean auto)
Sets the widths of the specified columns to automatically adjust to the largest column entry.
|
void |
setColWidthAutoSize(int row1,
int col,
int row2,
int col2,
boolean auto)
Sets the widths of the specified columns to automatically
|
void |
setConditionalFormats(ConditionFormat[] condfmts)
Sets the specified conditional formats for the current selection.
|
void |
setCSVSeparator(char c)
set the csv to use the specified char
|
void |
setCSVString(java.lang.String csv) |
void |
setDataValidation(DataValidation dataValidation)
Sets the specified data validations for the current selection.
|
void |
setDataValidationForCell(int row,
int col,
DataValidation dataValidation)
Deprecated.
used for fast adding cell only,should avoid multi-ranges/overlaped cell(range) adding.
|
void |
setDefaultColWidth(int width)
Sets the default column width of worksheet.
|
void |
setDefaultFontName(java.lang.String name)
set the default font name
|
void |
setDefaultRowHeight(int height)
Sets the default row height of whole worksheet.
|
void |
setDefinedName(java.lang.String name,
java.lang.String formula)
Sets the formula associated with a defined name
|
void |
setDocPropParsing(boolean b)
set this flag will allow to parse the document property,default not parsing
|
void |
setEnableProtection(boolean enableProtection)
enable/disable protection for current selected sheet.
|
void |
setEntry(int sheet,
int row,
int col,
java.lang.String value)
Sets the value of a specified cell on the specified worksheet.
|
void |
setEntry(int row,
int col,
java.lang.String value)
Sets the value to the specified cell of current selected worksheets.
|
void |
setFileShareProtection(java.lang.String password)
Set the workbook file to readonly with password
|
void |
setFormula(int sheet,
int row,
int col,
java.lang.String formula)
Sets the formula for the specified cell on the specified sheet.
|
void |
setFormula(int row,
int col,
java.lang.String formula)
Sets the formula for the specified cell in current selected sheets.
|
void |
setGroup(java.lang.String name)
group name
|
void |
setIgnoreEmptyCellsInParsing(boolean ignore)
ignore empty cells when load xlsx file
|
void |
setInlineCellTextMode(boolean inline)
enable the xlsx/xlsm file writing in the inlinestr cell text mode
|
void |
setIterationEnabled(boolean iterationEnabled)
Sets whether iteration is enabled.
|
void |
setIterationMax(int iterationMax)
Sets the maximum number of iterations.
|
void |
setIterationMaxChange(double iterationMaxChange)
Sets the maximum iteration change value.
|
void |
setNumber(int row,
int col,
double number)
Sets the numeric value of the specified cell in current selected sheet.
|
void |
setNumber(int sheet,
int row,
int col,
double number)
Sets the numeric value of the specified cell in the specified worksheet.
|
void |
setNumber(java.lang.String name,
double number)
Sets the numeric value of the specified cell in current selected sheet.
|
void |
setNumSheets(int sheets)
Sets the number of worksheets in the current workbook.
|
void |
setPaletteEntry(int entry,
int iRed,
int iGreen,
int iBlue)
Sets a color in the workbook color palette using decimal values.
|
void |
setPrintArea(java.lang.String formula)
Sets the current print area to the specified range
|
void |
setPrintAutoPageNumbering(boolean auto)
Turns on/off auto page numbering.
|
void |
setPrintBottomMargin(double printBottomMargin)
Sets the bottom print margin.
|
void |
setPrintFooter(java.lang.String printFooter)
Sets the current page footer.
|
void |
setPrintFooterMargin(double printFooterMargin)
Sets the page footer margin
|
void |
setPrintGridLines(boolean printGridLines)
Sets a flag indicating whether grid lines are printed for the current sheet.
|
void |
setPrintHCenter(boolean printHCenter)
Sets a flag indicating whether the current sheet is centered horizontally when printed.
|
void |
setPrintHeader(java.lang.String printHeader)
Sets the page header printed at the top of each page.
|
void |
setPrintHeaderMargin(double printHeaderMargin)
Sets the page header margin .
|
void |
setPrintHFAlignMargin(boolean alignWithMargin) |
void |
setPrintHFScaleDoc(boolean scaleWithDoc) |
void |
setPrintLandscape(boolean printLandscape)
set the orientation of the print job.
|
void |
setPrintLeftMargin(double printLeftMargin)
Sets the left print margin.
|
void |
setPrintLeftToRight(boolean printLeftToRight)
Sets a flag determining whether the current sheet is printed left to right then top to bottom, or top to bottom then left to right.
|
void |
setPrintNoColor(boolean printNoColor)
set print job printed in color black and white.
|
void |
setPrintNumberOfCopies(int i)
Sets the number copies to print.
|
void |
setPrintPaperSize(int width,
int height)
Sets the size of the paper in twips (1/20th of a point)
|
void |
setPrintPaperSize(short sSize)
Sets paper size print setting value.
|
void |
setPrintRightMargin(double printRightMargin)
Sets the right print margin in inches.
|
void |
setPrintRowColHeading(boolean heading)
Sets a flag that determines whether or not row/col headings are printed for the current sheet.
|
void |
setPrintScale(int scale)
Sets the scale factor for the current worksheet.
|
void |
setPrintScaleFitHPages(int horizontalPages)
Sets the number of horizontal pages to which the print job is fit.
|
void |
setPrintScaleFitToPage(boolean fitToPage)
Sets whether pages are scaled to fit the specified number of pages when printed.
|
void |
setPrintScaleFitVPages(int verticalPages)
Sets the number of vertical pages to which the print job is fit.
|
void |
setPrintStartPageNumber(int startPage)
Sets the starting page to print.
|
void |
setPrintTitles(java.lang.String formula)
Sets the print titles to be printed at the top of each page
|
void |
setPrintTopMargin(double printTopMargin)
Sets the top print margin.
|
void |
setPrintVCenter(boolean printVCenter)
Sets a flag indicating whether the current sheet is centered vertically when printed.
|
void |
setRangeStyle(RangeStyle rangestyle)
Sets the RangeStyle of the selected range of cells.
|
void |
setRangeStyle(RangeStyle rangestyle,
int row1,
int col1,
int row2,
int col2)
Sets the RangeStyle of the selected range of cells.
|
void |
setRowHeight(int row,
int height)
Sets the height of a single specified row.
|
void |
setRowHeightAutoSize(int row,
boolean automatic)
Specifies that the height of the specified row is automatically set to display the tallest entry in the row.
|
void |
setRowHidden(int row,
boolean rowHidden)
Sets the display status of the specified row.
|
void |
setRowOutlineLevel(int row1,
int row2,
int outlineLevel,
boolean additive)
Sets the outline level of a range of rows.
|
void |
setSelection(int row1,
int col1,
int row2,
int col2)
Selects the specified range and moves the active cell to the top left cell in the range.
|
void |
setSelection(java.lang.String range)
Selects the range represented by the formula.
|
void |
setSheet(int sheet)
Selects a worksheet
|
void |
setSheetHidden(int hidden)
Sets the hidden state for the current selected sheet.
|
void |
setSheetName(int sheet,
java.lang.String sheetName)
Assigns a name to the specified worksheet.
|
void |
setSheetProtected(int sheet,
boolean bProtected,
java.lang.String password)
Sets whether protection is enabled for the specified sheet.
|
void |
setSheetProtected(int sheet,
int protect,
java.lang.String password)
Sets whether protection is enabled for the specified sheet.
|
void |
setSheetRightToLeft(boolean flag)
sheet right to left setting
|
void |
setSheetTabColor(java.awt.Color color)
set the color to the sheet tab
|
void |
setSheetViewType(int viewType)
Sets the sheet view type..
|
void |
setShowGridLines(boolean showGridLines)
Sets whether grid lines are displayed.
|
void |
setShowHScrollBar(short showHScrollBar)
Sets the mode for the horizontal scroll bar.
|
void |
setShowOutlines(boolean t)
set whether the outline shown or not
|
void |
setShowRowColHeader(boolean showheader)
Sets whether row/col headers are displayed.
|
void |
setShowTabs(short showTabs)
Sets the visibility or position of the sheet name tabs on a workbook.
|
void |
setShowVScrollBar(short showVScrollBar)
Sets the mode for the vertical scroll bar.
|
void |
setShowZeroValues(boolean showZeroValues)
Sets whether zero value cells are displayed.
|
void |
setSummaryColsBeforeDetail(boolean summaryBeforeDetail)
Sets whether col outline summaries come before col detail information.
|
void |
setSummaryRowsBeforeDetail(boolean summaryBeforeDetail)
Sets whether row outline summaries come before row detail information.
|
void |
setTabbedText(int row1,
int col1,
boolean valuesOnly,
java.lang.String text)
set tab-delimited text in workbook
|
void |
setText(int sheet,
int row,
int col,
java.lang.String text)
Sets the value of the specified cell in the specified sheet.
|
void |
setText(int row,
int col,
java.lang.String text)
Sets the value of the specified cell for current selected sheet.
|
void |
setText(java.lang.String name,
java.lang.String text)
sets the text value to the specified named cell
|
void |
setTextSelection(int start,
int end)
Sets text selection for the selected cell
|
void |
setViewScale(int scale)
Sets the current display scale for a workbook.
|
void |
setWorkbookName(java.lang.String name)
the workbook name
|
void |
setWorkBookVersion(ExcelVersion ver) |
void |
setXMLStaxMode(boolean staxMode)
enable the xlsx/xlsm file parsing in the stax mode
|
java.awt.image.BufferedImage |
sheetRangeToImage(int row1,
int col1,
int row2,
int col2)
rendering specified range content to an image
|
void |
sheetRangeToImage(int row1,
int col1,
int row2,
int col2,
java.lang.String fileName)
write specified range to image
|
void |
sheetRangeToImage(java.lang.String fileName)
write sheet range to image
sheet range is from (0,0) to (last row,last col).
|
void |
sort(int row1,
int col1,
int row2,
int col2,
boolean byRows,
int[] keys)
Specified a range of data to be sorted by the keys.
|
void |
sort(int row1,
int col1,
int row2,
int col2,
boolean byRows,
int key1,
int key2,
int key3)
Specified a range of data to be sorted by three keys.
|
void |
subTotal(int row1,
int col1,
int row2,
int col2,
int changeCol,
int[] subs)
Specified a range of data to be subtotaled.
|
void |
unfreezePanes()
Removes frozen panes.
|
void |
write(java.io.OutputStream outputstream)
Saves the workbook to the specified output stream.
|
void |
write(java.io.OutputStream out,
ExcelSaveType excelSaveType,
java.lang.String password)
write workbook to OutputStream in diffrent Excel format.
|
void |
write(java.io.OutputStream outputstream,
java.lang.String password)
Saves the workbook to the specified output stream.
|
void |
write(java.lang.String fileName)
Saves the workbook to a file.
|
void |
write(java.lang.String fileName,
java.lang.String password)
Saves the workbook to a file.
|
void |
writeCSV(java.io.OutputStream outputstream)
Saves the workbook to the specified output stream.
|
void |
writeCSV(java.io.OutputStream outputstream,
char seperator,
boolean unicode,
boolean bValue) |
void |
writeCSV(java.lang.String fileName)
Saves the workbook to a file.
|
void |
writeCSV(java.lang.String fileName,
char seperator,
boolean unicode,
boolean bValue) |
void |
writeXLSB(java.io.OutputStream out)
write workbook in xlsb format
|
void |
writeXLSB(java.io.OutputStream stream,
java.lang.String password)
write workbook in xlsb format
|
void |
writeXLSX(java.io.OutputStream out)
write workbook to OutputStream in xlsx format.
|
void |
writeXLSX(java.io.OutputStream stream,
java.lang.String password)
write workbook in xlsx format
|
void |
writeXLSX(java.lang.String filename)
write workbook to specified excel file in xlsx format.
|
void |
writeXLSX(java.lang.String filename,
java.lang.String password)
write workbook in xlsx format
|
void |
writeXML(java.io.OutputStream out)
write workbook to OutputStream in Excel2003 spreadsheetxml format.
|
public static final short TypeEmpty
public static final short TypeNumber
public static final short TypeText
public static final short TypeLogical
public static final short TypeError
public static final short ShiftHorizontal
public static final short ShiftVertical
public static final short ShiftRows
public static final short ShiftColumns
public static final int sheetProtectionAllowNone
public static final int sheetProtectionAllowEditObjects
public static final int sheetProtectionAllowEditScenarios
public static final int sheetProtectionAllowFormatCells
public static final int sheetProtectionAllowFormatColumns
public static final int sheetProtectionAllowFormatRows
public static final int sheetProtectionAllowInsertColumns
public static final int sheetProtectionAllowInsertRows
public static final int sheetProtectionAllowInsertHyperlinks
public static final int sheetProtectionAllowDeleteColumns
public static final int sheetProtectionAllowDeleteRows
public static final int sheetProtectionAllowSelectLocked
public static final int sheetProtectionAllowSort
public static final int sheetProtectionAllowUseAutoFilter
public static final int sheetProtectionAllowUsePivotRanges
public static final int sheetProtectionAllowSelectUnlocked
public static final int sheetProtectionAllowDefault
public static final int sheetProtectionAllowLockedInCellEdit
public static final int sheetProtectionAllowLockedEditFocus
public static final int sheetProtectionAllowChangeLocked
public static final int sheetProtectionAllowChangeUnlocked
public static final int sheetProtectionAllowUseOutlining
public static final int sheetProtectionAllowEverything
public static final int bookProtectStructure
public static final int bookProtectWindow
public static final short TabsOff
public static final short TabsBottom
public static final short TabsTop
public static final short ShowOff
public static final short ShowOn
public static final short ShowAutomatic
public static final short SheetStateShown
public static final short SheetStateHidden
public static final short SheetStateVeryHidden
public static final int CopyFormulas
public static final int CopyValues
public static final int CopyFormats
public static final int CopyAll
public static final short SheetNormalView
public static final short SheetPageLayoutView
public static final short SheetPageBreakPreView
public java.lang.String getText(int sheet, int row, int col) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.java.lang.Exception
- Exceptionpublic void setText(int sheet, int row, int col, java.lang.String text) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.text
- the text value for the cell.java.lang.Exception
- if the cell reference is invalid or the text is too long.public void setText(java.lang.String name, java.lang.String text) throws java.lang.Exception
name
- name range top-left cell only if it have more than one celltext
- valuejava.lang.Exception
- invalid argumentpublic java.lang.String getText(java.lang.String name) throws java.lang.Exception
name
- name range top-left cell only if it have more than one celljava.lang.Exception
- invalid argumentpublic java.lang.String getText(int row, int col) throws java.lang.Exception
row
- number of row.col
- number of column.java.lang.Exception
- exceptionpublic java.lang.String getText(int row, int col, boolean calc) throws java.lang.Exception
row
- number of row.col
- number of column.calc
- need calculate before get the textjava.lang.Exception
- exceptionpublic void setText(int row, int col, java.lang.String text) throws java.lang.Exception
row
- number of row.col
- number of column.text
- the text value for the cell.java.lang.Exception
- if the cell reference is invalid or the text is too long.public void setNumber(int row, int col, double number) throws java.lang.Exception
row
- number of row.col
- number of column.number
- the cell value.java.lang.Exception
- if row or column numbers are not validpublic double getNumber(java.lang.String name) throws java.lang.Exception
name
- range cell name.java.lang.Exception
- exceptionpublic void setNumber(java.lang.String name, double number) throws java.lang.Exception
name
- range name.number
- the cell value.java.lang.Exception
- exception if row or column numbers are not validpublic double getNumber(int row, int col) throws java.lang.Exception
row
- number of row.col
- number of column.java.lang.Exception
- exceptionpublic void setNumber(int sheet, int row, int col, double number) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.number
- the cell value.java.lang.Exception
- exceptionpublic double getNumber(int sheet, int row, int col) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.java.lang.Exception
- exceptionpublic boolean isArrayFormula(int row, int col)
row
- number of row.col
- number of column.public void setArrayFormula(int row, int col, int row2, int col2, java.lang.String formula) throws SXException
row
- - start row number.col
- - start col number.row2
- - end row number.col2
- - end col number.formula
- - formula for the active cell. The string should have a leading equal sign (=).SXException
- If the string is not a valid workbook formula.public void setFormula(int row, int col, java.lang.String formula) throws java.lang.Exception
row
- number of row.col
- number of column.formula
- formula for the active cell. The string should not have a leading equal sign (=).java.lang.Exception
- if the string is not a valid workbook formula.public java.lang.String getFormula(int row, int col) throws java.lang.Exception
row
- number of row.col
- number of column.java.lang.Exception
- exceptionpublic void setFormula(int sheet, int row, int col, java.lang.String formula) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.formula
- formula for the active cell. The string should not have a leading equal sign (=).java.lang.Exception
- if the string is not a valid workbook formula.public java.lang.String getFormula(int sheet, int row, int col) throws java.lang.Exception
sheet
- number of sheet.row
- number of row.col
- number of column.java.lang.Exception
- exceptionpublic void setSheet(int sheet) throws java.lang.Exception
sheet
- index number of the sheet. Worksheets are indexed from left to right beginning with 0.java.lang.Exception
- exceptionpublic int getSheet()
public void moveSheet(int insertAt) throws java.lang.Exception
insertAt
- The location to which to move the sheets.java.lang.Exception
- if insertAt is not a valid sheet index.public void setNumSheets(int sheets) throws java.lang.Exception
insertSheets(int, int)
method.
To delete worksheets between existing worksheets, use the deleteSheets(int, int)
method.sheets
- the number of worksheets that make up the workbook.java.lang.Exception
- exceptionpublic int getNumSheets()
public void deleteSheets(int sheet, int sheets) throws java.lang.Exception
sheet
- specifies the index to the first worksheet to be deleted. do not confuse the index with the sheet name on the sheet tab.sheets
- specifies how many sheets to delete, beginning with the worksheet specified by sheet.java.lang.Exception
- if a parameter is invalidpublic void insertSheets(int sheet, int sheets) throws java.lang.Exception
sheet
- identifies the index number of the worksheet in front of which you want to insert the new sheets. Sheets are indexed from left to right beginning with 0. do not confuse the index number with the sheet name that appears on the sheet tab.sheets
- determines how many sheets are inserted before sheet.java.lang.Exception
- exceptionpublic void setSheetName(int sheet, java.lang.String sheetName) throws java.lang.Exception
sheet
- index number of the sheet. Worksheets are indexed from left to right beginning with 0.sheetName
- the name of the sheet.java.lang.Exception
- exceptionpublic int findSheetByName(java.lang.String sheetName)
sheetName
- sheet Namepublic java.lang.String getSheetName(int sheet) throws java.lang.Exception
sheet
- index number of the sheet. Worksheets are indexed from left to right beginning with 0.java.lang.Exception
- exceptionpublic void copySheet(int insertAt) throws java.lang.Exception
insertAt
- The location at which to insert the new sheets.java.lang.Exception
- if insertAt is not a valid sheet index.public int getHiddenState()
SheetStateShown
show the sheet.
SheetStateHiddenSheetStateHidden
hide the sheet.
SheetStateVeryHiddenSheetStateVeryHidden
hide the sheet and can not reshow the sheet with the GUI.public void setSheetHidden(int hidden) throws java.lang.Exception
hidden
- one of the following flags indicating the desired hidden state:
SheetStateShownSheetStateShown
show the sheet.
SheetStateHiddenSheetStateHidden
hide the sheet.
SheetStateVeryHiddenSheetStateVeryHidden
hide the sheet and can not reshow the sheet with the GUI.java.lang.Exception
- if this call would hide the last visible sheet or if the book is protected.public void copyRange(int dstRow1, int dstCol1, int dstRow2, int dstCol2, int srcRow1, int srcCol1, int srcRow2, int srcCol2) throws java.lang.Exception
dstRow1
- the first row in the destination range.dstCol1
- the first column in the destination range.dstRow2
- the ending row in the destination range, inclusive.dstCol2
- the ending column in the destination range, inclusive.srcRow1
- the first row in the source range.srcCol1
- the first column in the source range.srcRow2
- the ending row in the source range, inclusive.srcCol2
- the ending column in the source range, inclusive.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- if a parameter is invalidpublic void copyRange(int dstRow1, int dstCol1, int dstRow2, int dstCol2, WorkBook book, int srcRow1, int srcCol1, int srcRow2, int srcCol2) throws java.lang.Exception
dstRow1
- the first row in the destination range.dstCol1
- the first column in the destination range.dstRow2
- the ending row in the destination range, inclusive.dstCol2
- the ending column in the destination range, inclusive.book
- the source workbook.srcRow1
- the first row in the source range.srcCol1
- the first column in the source range.srcRow2
- the ending row in the source range, inclusive.srcCol2
- the ending column in the source range, inclusive.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- if a parameter is invalidpublic void copyRange(int dstSheet, int dstRow1, int dstCol1, int dstRow2, int dstCol2, WorkBook book, int srcSheet, int srcRow1, int srcCol1, int srcRow2, int srcCol2) throws java.lang.Exception
dstSheet
- the destination sheet index.dstRow1
- the first row in the destination range.dstCol1
- the first column in the destination range.dstRow2
- the ending row in the destination range, inclusive.dstCol2
- the ending column in the destination range, inclusive.book
- the source workbook.srcSheet
- the source sheet index.srcRow1
- the first row in the source range.srcCol1
- the first column in the source range.srcRow2
- the ending row in the source range, inclusive.srcCol2
- the ending column in the source range, inclusive.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- if a parameter is invalidpublic void copyRange(int dstSheet, int dstRow1, int dstCol1, int dstRow2, int dstCol2, WorkBook book, int srcSheet, int srcRow1, int srcCol1, int srcRow2, int srcCol2, int what) throws java.lang.Exception
dstSheet
- the destination sheet index.dstRow1
- the first row in the destination range.dstCol1
- the first column in the destination range.dstRow2
- the ending row in the destination range, inclusive.dstCol2
- the ending column in the destination range, inclusive.book
- the source workbook.srcSheet
- the source sheet index.srcRow1
- the first row in the source range.srcCol1
- the first column in the source range.srcRow2
- the ending row in the source range, inclusive.srcCol2
- the ending column in the source range, inclusive.what
- one or more of the following constants:
CopyFormulas = 1CopyFormulas
CopyValues = 2CopyValues
CopyFormats = 4CopyFormats
CopyAll = 7CopyAll
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- if a parameter is invalidpublic void clearRange(int row1, int col1, int row2, int col2) throws java.lang.Exception
row1
- Coordinate specifying the beginning row of the range.col1
- Coordinate specifying the beginning column of the range.row2
- Coordinate specifying the ending row of the range.col2
- Coordinate specifying the ending column of the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- exceptionpublic void deleteRange(int row1, int col1, int row2, int col2, short shift) throws java.lang.Exception
row1
- Coordinate specifying the beginning row of the range.col1
- Coordinate specifying the beginning column of the range.row2
- Coordinate specifying the ending row of the range.col2
- Coordinate specifying the ending column of the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.shift
- shift direction
ShiftHorizontalShiftHorizontal
Shifts cells horizontally beyond the last column, one cell to the right.
ShiftVerticalShiftVertical
Shifts cells vertically beyond the last row, one cell up.
ShiftRowsShiftRows
Shifts all cells beyond the last row, up to the first deleted row.
ShiftColumnsShiftColumns
Shifts all cells beyond the last column to the left.java.lang.Exception
- if a parameter is invalidpublic void deleteRange(int row1, int col1, int row2, int col2, short shift, boolean bFixformulas) throws java.lang.Exception
row1
- Coordinate specifying the beginning row of the range.col1
- Coordinate specifying the beginning column of the range.row2
- Coordinate specifying the ending row of the range.col2
- Coordinate specifying the ending column of the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.shift
- shift direction
ShiftHorizontalShiftHorizontal
Shifts cells horizontally beyond the last column, one cell to the right.
ShiftVerticalShiftVertical
Shifts cells vertically beyond the last row, one cell up.
ShiftRowsShiftRows
Shifts all cells beyond the last row, up to the first deleted row.
ShiftColumnsShiftColumns
Shifts all cells beyond the last column to the left.bFixformulas
- whether fix the formulas after delete the rangejava.lang.Exception
- if a parameter is invalidpublic void insertRange(int row1, int col1, int row2, int col2, short shift) throws java.lang.Exception
row1
- Coordinate specifying the beginning row of the range.col1
- Coordinate specifying the beginning column of the range.row2
- Coordinate specifying the ending row of the range.col2
- Coordinate specifying the ending column of the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.shift
- shift direction
ShiftHorizontalShiftHorizontal
Shifts cells horizontally beyond the last column, one cell to the right.
ShiftVerticalShiftVertical
Shifts cells vertically beyond the last row, one cell up.
ShiftRowsShiftRows
Shifts all cells beyond the last row, up to the first deleted row.
ShiftColumnsShiftColumns
Shifts all cells beyond the last column to the left.java.lang.Exception
- if a parameter is invalidpublic RangeStyle getRangeStyle() throws java.lang.Exception
java.lang.Exception
- exceptionpublic RangeStyle getRangeStyle(int row1, int col1, int row2, int col2) throws java.lang.Exception
row1
- the first row in the range.col1
- the first column in the range.row2
- the ending row in the range.col2
- the ending column in the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- exceptionpublic RangeStyle getConditionalFormatAppliedCellStyle(int sheet1, int row1, int col1) throws java.lang.Exception
sheet1
- the sheet index.row1
- the first row in the range.col1
- the first column in the range.
Rows are indexed from top to bottom beginning with 0.
Sheets and columns are indexed from left to right beginning with 0.java.lang.Exception
- exceptionpublic void setRangeStyle(RangeStyle rangestyle) throws java.lang.Exception
rangestyle
- RangeStylejava.lang.Exception
- exceptionpublic void setRangeStyle(RangeStyle rangestyle, int row1, int col1, int row2, int col2) throws java.lang.Exception
rangestyle
- RangeStylerow1
- the first row in the range.col1
- the first column in the range.row2
- the ending row in the range.col2
- the ending column in the range.java.lang.Exception
- exceptionpublic int[] getRowPageBreaks()
public void addRowPageBreak(int row) throws java.lang.Exception
row
- integer indicating the row.java.lang.Exception
- if parameter is invalidpublic void removeRowPageBreak(int row) throws java.lang.Exception
row
- the index number of the row where the page break is removed.java.lang.Exception
- exceptionpublic int[] getColPageBreaks()
public void addColPageBreak(int col) throws java.lang.Exception
col
- an integer indicating the column.java.lang.Exception
- if argument is invalid.public void removeColPageBreak(int col) throws java.lang.Exception
col
- the index number of the column.java.lang.Exception
- exceptionpublic java.lang.String getDefinedName(java.lang.String name) throws java.lang.Exception
name
- a defined name.java.lang.Exception
- if the specified name does not existpublic java.lang.String getDefinedName(int name) throws java.lang.Exception
name
- identifies a name by index number. Defined names are numbered in the order in which they are created, beginning with 1.java.lang.Exception
- if an invalid index number is specifiedpublic int getDefinedNameCount()
public void setDefinedName(java.lang.String name, java.lang.String formula) throws java.lang.Exception
name
- A defined name.
Enter an existing name if you are returning the formula associated with the name or changing the value associated with the name.
Enter a unique name if you are creating a new value.formula
- Describes the range represented by name.
A name can refer to a cell, a group of cells, a value, or a formula.
When setting name, do not include a leading equal sign (=)in the formula.java.lang.Exception
- exceptionpublic void deleteDefinedName(java.lang.String name) throws SXException
name
- A defined name.java.lang.Exception
- exceptionSXException
public void setRowHeight(int row, int height) throws java.lang.Exception
row
- the row number.height
- the row height in twips. A twip is 1/1440th of an inch.java.lang.Exception
- exceptionpublic int getRowHeight(int row) throws java.lang.Exception
row
- an integer indicating the index number of the row.java.lang.Exception
- exceptionpublic void setDefaultRowHeight(int height) throws java.lang.Exception
height
- the row height in twips. A twip is 1/1440th of an inch.java.lang.Exception
- exceptionpublic int getDefaultRowHeight() throws java.lang.Exception
java.lang.Exception
- exceptionpublic boolean isRowHeightAutoSize(int row) throws java.lang.Exception
row
- the row numberjava.lang.Exception
- exceptionpublic void setRowHeightAutoSize(int row, boolean automatic) throws java.lang.Exception
row
- the row numberautomatic
- Specifies whether rows are automatically resizedjava.lang.Exception
- exceptionpublic void setRowHidden(int row, boolean rowHidden) throws java.lang.Exception
row
- row number.rowHidden
- Specifies whether the row is hidden (true) or displayed (false).java.lang.Exception
- exceptionpublic boolean isRowHidden(int row) throws java.lang.Exception
row
- identifies the row by numberjava.lang.Exception
- exceptionpublic void setRowOutlineLevel(int row1, int row2, int outlineLevel, boolean additive) throws java.lang.Exception
row1
- the first row in the range.row2
- the last row in the range.outlineLevel
- the outline level to set.additive
- Specifies whether the outline level is an absolute value to set, or should be added to the current outline level. if false, the outline level of the specified rows is set to the value set with the outlineLevel parameter.
Otherwise, the value set with the outlineLevel parameter is added to the current outline level of each row.
Note: The outline level may be set from zero to seven.java.lang.Exception
- exceptionpublic int getRowOutlineLevel(int row) throws java.lang.Exception
row
- an integer indicating the index number of the row.java.lang.Exception
- exceptionpublic void setSummaryRowsBeforeDetail(boolean summaryBeforeDetail)
summaryBeforeDetail
- if true, row outline summaries are displayed before row detail information.public boolean isSummaryRowsBeforeDetail()
public void setColWidth(int col, int width) throws java.lang.Exception
col
- identifies a column by number.width
- the width of the column. Column width is specified in units equal to 1/256th of the character 0's width in the default font.java.lang.Exception
- exceptionpublic int getColWidth(int col) throws java.lang.Exception
col
- an integer indicating the column index number.java.lang.Exception
- exceptionpublic void setDefaultColWidth(int width) throws java.lang.Exception
width
- the width of the column. Column width is specified in units equal to 1/256th of the character 0's width in the default font.java.lang.Exception
- exceptionpublic int getDefaultColWidth() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void setColWidthAutoSize(int col, boolean auto) throws java.lang.Exception
col
- number identifying the column.auto
- auto resize the column widthjava.lang.Exception
- exceptionpublic void setColWidthAutoSize(int row1, int col, int row2, int col2, boolean auto) throws java.lang.Exception
row1
- start rowcol
- start colrow2
- end rowcol2
- end colauto
- auto flag to resize the column widthjava.lang.Exception
- exceptionpublic void setColHidden(int col, boolean colHidden) throws java.lang.Exception
col
- number identifying the column.colHidden
- the specified column is hidden.java.lang.Exception
- exceptionpublic boolean isColHidden(int col) throws java.lang.Exception
col
- identifies a column by number. Columns are indexed from left to right beginning at 0.java.lang.Exception
- if a parameter is invalidpublic void setColOutlineLevel(int col1, int col2, int outlineLevel, boolean additive) throws java.lang.Exception
col1
- the first column in the range.col2
- the last column in the range.outlineLevel
- the outline level to set.additive
- Specifies whether the outline level is an absolute value to set, or should be added to the current outline level.
if this value is false, the outline level of the specified columns will be set to outlineLevel.
Otherwise, outlineLevel will be added to the current outline level of each column.
Note: The outline level may be set from zero to seven.java.lang.Exception
- exceptionpublic int getColOutlineLevel(int col) throws java.lang.Exception
col
- identifies a column by number. Columns are indexed from left to right beginning at 0.java.lang.Exception
- exceptionpublic void setSummaryColsBeforeDetail(boolean summaryBeforeDetail)
summaryBeforeDetail
- if true, col outline summaries are displayed before col detail information.public boolean isSummaryColsBeforeDetail()
public int getViewScale()
public void setViewScale(int scale) throws java.lang.Exception
scale
- an integer ranging from 10 to 400. 100 percent is normal display.java.lang.Exception
- if the argument is invalidpublic void freezePanes(int topRow, int leftCol, int splitRows, int splitCols, boolean splitView) throws java.lang.Exception
topRow
- The top row of the top frozen pane. (Ignored if splitRow is 0.)leftCol
- The left column of the left frozen pane. (Ignored if splitCol is 0.)splitRows
- The number of rows that should be visible in the top pane. Use 0 to specify no top frozen pane.splitCols
- The number of cols that should be visible in the left pane. Use 0 to specify no left frozen pane.splitView
- Specifies whether this is a frozen split view. if true, autoFreezePanes and unfreezePanes will convert the frozen panes to a split view.
if false, those methods will set the view to its default (unsplit) state.java.lang.Exception
- exceptionpublic void unfreezePanes()
public java.lang.String formatRCNr(int row, int col, boolean doAbsolute) throws java.lang.Exception
row
- the row number of the reference.col
- the column number of the reference.doAbsolute
- boolean. if true, uses absolute references. if false, uses relative references.java.lang.Exception
- exceptionpublic void setSelection(int row1, int col1, int row2, int col2) throws java.lang.Exception
row1
- Coordinate specifying the beginning row of the range.col1
- Coordinate specifying the beginning column of the range.row2
- Coordinate specifying the ending row of the range.col2
- Coordinate specifying the ending column of the range.java.lang.Exception
- exceptionpublic RangeArea getSelection() throws java.lang.Exception
java.lang.Exception
- exceptionpublic RangeArea[] getMergedRanges() throws java.lang.Exception
java.lang.Exception
- invalid argumentpublic void setSelection(java.lang.String range) throws java.lang.Exception
range
- Identifies the starting and ending rows and columns of the selection or a defined name that represents the selectionjava.lang.Exception
- exceptionpublic void editCopyRight() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void editCopyDown() throws java.lang.Exception
java.lang.Exception
- exceptionpublic int getPaletteEntry(int entry) throws java.lang.Exception
entry
- Zero-based index of the entry to changejava.lang.Exception
- exceptionpublic void recalc() throws java.lang.Exception
java.lang.Exception
- exceptionpublic boolean isIterationEnabled()
public void setIterationEnabled(boolean iterationEnabled)
iterationEnabled
- true = iteration enabled.public int getIterationMax()
public void setIterationMax(int iterationMax)
iterationMax
- Maximum number of iterations.public double getIterationMaxChange()
public void setIterationMaxChange(double iterationMaxChange)
iterationMaxChange
- The maximum change value for iterations.public PictureShape addPicture(double x1, double y1, double x2, double y2, java.lang.String filename) throws java.lang.Exception
x1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.filename
- image file namejava.lang.Exception
- if a parameter is invalidpublic PictureShape addPicture(double x1, double y1, double x2, double y2, byte[] picData) throws java.lang.Exception
x1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.picData
- byte array of the picturejava.lang.Exception
- if a parameter is invalidpublic PictureShape getPictureShape(int index) throws java.lang.Exception
index
- Picture index in the sheetjava.lang.Exception
- if not a valid Picture indexpublic void removePicture(int index) throws java.lang.Exception
index
- image indexjava.lang.Exception
- exceptionpublic int getPictureCount()
public ChartShape addChart(double x1, double y1, double x2, double y2) throws java.lang.Exception
x1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.java.lang.Exception
- if a parameter is invalid.public ChartShape addChartSheet(int sheetIndex) throws java.lang.Exception
sheetIndex
- sheet indexjava.lang.Exception
- if a parameter is invalid.public ChartShape getChart(int index) throws java.lang.Exception
index
- chart index in the sheetjava.lang.Exception
- if not a valid chart indexpublic void removeChart(int index) throws java.lang.Exception
index
- chart indexjava.lang.Exception
- exceptionpublic int getChartCount()
public void copyChartTo(ChartShape chartShape, int x1, int y1, int x2, int y2) throws java.lang.Exception
chartShape
- source chart shapex1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.java.lang.Exception
- invalid parameterpublic HyperLink addHyperlink(int row1, int col1, int row2, int col2, java.lang.String url, int type, java.lang.String tooltip) throws java.lang.Exception
row1
- the beginning row coordinate of the Hyperlink.col1
- the beginning column coordinate of the Hyperlink.row2
- the ending row coordinate of the Hyperlink.col2
- the ending column coordinate of the Hyperlink.url
- the link string.type
- 0 - Intra doc, 1 - Absolute URL, 2 - Relative URL,
3 - Absolute file path, 4 - Relative File path, 5 - Network File path.tooltip
- the tool tip string this can be null.java.lang.Exception
- exceptionpublic HyperLink getHyperlink(int index) throws java.lang.Exception
index
- index in the sheetjava.lang.Exception
- exceptionpublic HyperLink[] getHyperlinks() throws java.lang.Exception
java.lang.Exception
public HyperLink getHyperlink(int row, int col) throws java.lang.Exception
row
- the row coordinate of the hyperlink.col
- the col coordinate of the hyperlink.java.lang.Exception
- exceptionpublic void removeHyperlink(HyperLink hyperlink) throws java.lang.Exception
hyperlink
- hyperlink objectjava.lang.Exception
- exceptionpublic void addComment(int row1, int col1, java.lang.String text, java.lang.String author) throws java.lang.Exception
row1
- the row coordinate of the comment.col1
- the col coordinate of the comment.text
- comment text contentauthor
- comment authorjava.lang.Exception
- exceptionpublic CommentShape getComment(int row1, int col1) throws java.lang.Exception
row1
- the row coordinate of the cell.col1
- the col coordinate of the cell.java.lang.Exception
- exceptionpublic int getCommentCount()
public CommentShape getComment(int index) throws java.lang.Exception
index
- Comment index in the sheetjava.lang.Exception
- if not a valid chart indexpublic void removeComment(CommentShape comment) throws java.lang.Exception
comment
- comment shapejava.lang.Exception
- exceptionpublic void autoFilter() throws java.lang.Exception
java.lang.Exception
- if this range cannot be filtered.public ConditionFormat CreateConditionFormat()
public void setConditionalFormats(ConditionFormat[] condfmts) throws java.lang.Exception
condfmts
- an array of 0...3 ConditionalFormat objects to apply to the current selection.
if this is null, or has a length of zero, conditional formats are removed.java.lang.Exception
- exceptionpublic ConditionFormat[] getConditionalFormats() throws java.lang.Exception
java.lang.Exception
- if there is not a valid selectionpublic void setPaletteEntry(int entry, int iRed, int iGreen, int iBlue)
entry
- Zero-based index of the entry to change.iRed
- the decimal value of the red component of the color.iGreen
- the the decimal value of the green component of the color.iBlue
- the the decimal value of the blue component of the color.public FormControlShape addFormControl(double x1, double y1, double x2, double y2, int type) throws java.lang.Exception
x1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.type
- Form control type 20-ComBox 11-CheckBox 18-ListBoxjava.lang.Exception
- if a parameter is invalid.public FormControlShape getFormControl(int type, int index)
type
- Form control type 20-ComBox 11-CheckBox 18-ListBoxindex
- control index in sheetpublic void removeFormControl(int type, int index) throws java.lang.Exception
type
- Form control type 20-ComBox 11-CheckBox 18-ListBoxindex
- control index in sheetjava.lang.Exception
- no control foundpublic AutoShape addAutoShape(double x1, double y1, double x2, double y2, short type) throws java.lang.Exception
x1
- Coordinate of the first anchor point of the object; measured in columns from the left edge of the worksheet.y1
- Coordinate of the first anchor point; measured in rows from the top edge of the worksheet.x2
- Coordinate of the second anchor point; measured in columns from the left edge of the worksheet.y2
- Coordinate of the second anchor point; measured in rows from the top edge of the worksheet.type
- Form control type 0-Rectangle 1-Oval 2-Line 3-TextBoxjava.lang.Exception
- if a parameter is invalid.public void setCSVString(java.lang.String csv) throws java.lang.Exception
java.lang.Exception
public void readCSV(java.lang.String fileName) throws java.lang.Exception
fileName
- csv file namejava.lang.Exception
- exceptionpublic void read(java.io.InputStream inputstream) throws java.lang.Exception
inputstream
- the input stream to read from.java.lang.Exception
- if an error occurspublic void read(java.io.InputStream inputstream, java.lang.String password) throws java.lang.Exception
inputstream
- the input stream to read from.password
- The password to use when opening a password-protected file.java.lang.Exception
- if an error occurspublic void read(java.lang.String fileName) throws java.lang.Exception
fileName
- the path and filename of the workbook.java.lang.Exception
- if an error occurspublic void read(java.lang.String fileName, java.lang.String password) throws java.lang.Exception
fileName
- the path and filename of the workbook.password
- The password to use when opening a password-protected file.java.lang.Exception
- if an error occurspublic void write(java.lang.String fileName) throws java.lang.Exception
fileName
- path describing name and location of the file.java.lang.Exception
- if an error occurspublic void writeCSV(java.lang.String fileName) throws java.lang.Exception
fileName
- path describing name and location of the file.java.lang.Exception
- if an error occurspublic void writeCSV(java.lang.String fileName, char seperator, boolean unicode, boolean bValue) throws java.lang.Exception
java.lang.Exception
public void write(java.lang.String fileName, java.lang.String password) throws java.lang.Exception
fileName
- path describing name and location of the file.password
- The password to use when opening a password-protected file.java.lang.Exception
- if an error occurspublic void write(java.io.OutputStream outputstream) throws java.lang.Exception
outputstream
- outputstream that describes where to save the file.java.lang.Exception
- if an error occurspublic void writeCSV(java.io.OutputStream outputstream) throws java.lang.Exception
outputstream
- outputstream that describes where to save the file.java.lang.Exception
- if an error occurspublic void writeCSV(java.io.OutputStream outputstream, char seperator, boolean unicode, boolean bValue) throws java.lang.Exception
java.lang.Exception
public void write(java.io.OutputStream outputstream, java.lang.String password) throws java.lang.Exception
outputstream
- outputstream that describes where to save the file.password
- The password to use when opening a password-protected file.java.lang.Exception
- if an error occurspublic void setTextSelection(int start, int end) throws java.lang.Exception
start
- starting positon of selection.end
- ending positon of selection.java.lang.Exception
- if the positions are invalid, selected cell is not text or more than one cell is selected.public BookPivotRangeModel getPivotModel()
public BookPivotRange addPivotRange(int srcSheet, int srcRow1, int srcCol1, int srcRow2, int srcCol2, int dstSheet, int dstRow1, int dstCol1) throws SXException
srcSheet
- source sheetsrcRow1
- row1srcCol1
- col1srcRow2
- row2srcCol2
- col2dstSheet
- location sheetdstRow1
- row of the top-left celldstCol1
- col of the top-left cellSXException
public BookPivotRange addPivotRange(com.smartxls.data.SXQuery query, int dstSheet, int dstRow1, int dstCol1) throws SXException
query
- external data source objectdstSheet
- location sheetdstRow1
- row of the top-left celldstCol1
- col of the top-left cellSXException
public BookPivotRange addPivotRange(java.lang.String linkRange, java.lang.String destRange) throws SXException
linkRange
- source link data rangedestRange
- dest location where the pivot table will be placedSXException
public BookPivotRange getActivePivotRange(int activeRow1, int activeCol1) throws SXException
activeRow1
- row1activeCol1
- col1SXException
public void setActiveCell(int row, int col) throws java.lang.Exception
row
- the active cell row coordinate.col
- the active cell column coordinate.java.lang.Exception
- exceptionpublic int getActiveRow()
public int getActiveCol()
public int getLastCol()
public int getLastColForRow(int row) throws java.lang.Exception
row
- the specified row.java.lang.Exception
- exceptionpublic int getLastRow()
public short getType(int row, int col) throws java.lang.Exception
row
- identifies the cell row by number.col
- identifies the cell column by number.java.lang.Exception
- exceptionpublic short getType(int sheet, int row, int col) throws java.lang.Exception
sheet
- number of sheet.row
- identifies the cell row by number.col
- identifies the cell column by number.java.lang.Exception
- exceptionpublic short getType() throws java.lang.Exception
java.lang.Exception
- exceptionpublic java.lang.String getPrintHeader()
public void setPrintHeader(java.lang.String printHeader)
printHeader
- string that contains text and codes for header.public java.lang.String getPrintFooter()
public void setPrintFooter(java.lang.String printFooter)
printFooter
- String that contains the codes and text that make up the footer.public double getPrintHeaderMargin()
public void setPrintHeaderMargin(double printHeaderMargin)
printHeaderMargin
- size of the margin.public double getPrintFooterMargin()
public void setPrintFooterMargin(double printFooterMargin)
printFooterMargin
- size of the margin.public double getPrintTopMargin()
public void setPrintTopMargin(double printTopMargin)
printTopMargin
- the top print margin.public double getPrintBottomMargin()
public void setPrintBottomMargin(double printBottomMargin)
printBottomMargin
- the bottom print margin.public double getPrintLeftMargin()
public void setPrintLeftMargin(double printLeftMargin)
printLeftMargin
- the left print margin.public double getPrintRightMargin()
public void setPrintRightMargin(double printRightMargin)
printRightMargin
- a double value indicating the right print margin.public short getPrintPaperSize()
public void setPrintPaperSize(short sSize) throws java.lang.Exception
sSize
- A short indicating paper size.
Letter = 1
LetterSmall = 2
PaperA3 = 8
PaperA4 = 9java.lang.Exception
- if argument is invalid.public int getPrintPaperHeight()
public int getPrintPaperWidth()
public void setPrintPaperSize(int width, int height) throws java.lang.Exception
width
- width of paper in twips.height
- height of paper in twips.
Letter 12240, 15840
A4 11906, 16838java.lang.Exception
- if a parameter is invalidpublic int getPrintScale()
public void setPrintScale(int scale) throws java.lang.Exception
scale
- Indicates the scale factor. Scale factor ranges from 10 to 400.java.lang.Exception
- if a parameter is invalidpublic boolean isPrintScaleFitToPage()
setPrintScaleFitToPage(boolean)
method.
Returns false if the scale percentage returned is used to print the workbook.public void setPrintScaleFitToPage(boolean fitToPage)
setPrintScaleFitHPages(int)
and setPrintScaleFitVPages(int)
methods.fitToPage
- true/false. true = fit number of pages specified inpublic int getPrintScaleFitHPages()
public void setPrintScaleFitHPages(int horizontalPages) throws java.lang.Exception
horizontalPages
- the number of horizontal pages to which the print job is fit.java.lang.Exception
- if a parameter is invalidpublic int getPrintScaleFitVPages()
public void setPrintScaleFitVPages(int verticalPages) throws java.lang.Exception
setPrintScaleFitToPage(boolean)
method is called with false.verticalPages
- the number of vertical pages to which the print job is fit.java.lang.Exception
- if a parameter is invalidpublic boolean isPrintAutoPageNumbering()
public void setPrintAutoPageNumbering(boolean auto)
auto
- true/falsepublic int getPrintStartPageNumber()
public void setPrintStartPageNumber(int startPage) throws java.lang.Exception
startPage
- an integer (1-n) indicating the starting page number.java.lang.Exception
- if a parameter is invalidpublic java.lang.String getPrintTitles() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void setPrintTitles(java.lang.String formula) throws java.lang.Exception
formula
- formula that identifies the range or ranges holding the titles.java.lang.Exception
- if formula is invalidpublic boolean isPrintRowColHeading()
public void setPrintRowColHeading(boolean heading)
heading
- boolean true/falsepublic boolean isPrintGridLines()
public void setPrintGridLines(boolean printGridLines)
printGridLines
- true/falsepublic boolean isPrintVCenter()
public void setPrintVCenter(boolean printVCenter)
printVCenter
- true/falsepublic boolean isPrintHCenter()
public void setPrintHCenter(boolean printHCenter)
printHCenter
- true/falsepublic boolean isPrintLandscape()
public void setPrintLandscape(boolean printLandscape)
printLandscape
- boolean. true = landscape orientation. false = portrait orientation.public boolean isPrintLeftToRight()
public void setPrintLeftToRight(boolean printLeftToRight)
printLeftToRight
- boolean. true = print the current sheet left to right then top to bottom.public boolean isPrintNoColor()
public void setPrintNoColor(boolean printNoColor)
printNoColor
- boolean. true = turn off colors and patterns.public int getPrintNumberOfCopies() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void setPrintNumberOfCopies(int i) throws java.lang.Exception
i
- number of copies to print.java.lang.Exception
- if parameter is invalidpublic java.lang.String getPrintArea() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void setPrintArea(java.lang.String formula) throws java.lang.Exception
formula
- - description of the print area range.java.lang.Exception
- exceptionpublic boolean isPrintHFScaleDoc()
public void setPrintHFScaleDoc(boolean scaleWithDoc)
public boolean isPrintHFAlignMargin()
public void setPrintHFAlignMargin(boolean alignWithMargin)
public boolean isShowRowColHeader()
public void setShowRowColHeader(boolean showheader)
showheader
- true = row/col headers displayed.public boolean isShowGridLines()
public void setShowGridLines(boolean showGridLines)
showGridLines
- true = grid lines displayed.public void setDataValidation(DataValidation dataValidation) throws java.lang.Exception
dataValidation
- data validation objects to apply to the current selection.
if this is null, or it has the type of zero, validation in current selection will be removed.java.lang.Exception
- exceptionpublic void setDataValidationForCell(int row, int col, DataValidation dataValidation) throws java.lang.Exception
row
- row numbercol
- column numberdataValidation
- data validation objects to apply to the current selection.
if this is null, or it has the type of zero, validation in current selection will be removed.java.lang.Exception
- exceptionpublic DataValidation CreateDataValidation()
public DataValidation getValidation(int row1, int col1)
row1
- row numbercol1
- column numberpublic void setXMLStaxMode(boolean staxMode)
staxMode
- in this mode it will use stax parser to parse the openxml content,it will improve the parsing speed and save the memory usage.public void setInlineCellTextMode(boolean inline)
inline
- in this mode all cell text will not save to SST(share string table),it will improve the performance in writing huge data,but output file size may be more big.public void setIgnoreEmptyCellsInParsing(boolean ignore)
ignore
- no parsingpublic void readXLSX(java.lang.String filename) throws java.lang.Exception
filename
- - the path and filename of the excel xlsx filejava.lang.Exception
- exceptionpublic void readXLSX(java.io.InputStream in) throws java.lang.Exception
in
- - the xlsx file inputstreamjava.lang.Exception
- exceptionpublic void readXML(java.io.InputStream in) throws java.lang.Exception
in
- - the xlsx file inputstreamjava.lang.Exception
- exceptionpublic void readXLSX(java.lang.String filename, java.lang.String password) throws java.lang.Exception
filename
- file pathpassword
- file open passwordjava.lang.Exception
- if invalid argumentpublic void readXLSX(java.io.InputStream stream, java.lang.String password) throws java.lang.Exception
stream
- streampassword
- file open passwordjava.lang.Exception
- invalid argumentpublic void readXLSB(java.lang.String filename) throws java.lang.Exception
filename
- - the xlsb file namejava.lang.Exception
- exceptionpublic void readXLSB(java.io.InputStream in) throws java.lang.Exception
in
- - the xlsb file inputstreamjava.lang.Exception
- exceptionpublic void readXLSB(java.lang.String filename, java.lang.String pass) throws java.lang.Exception
filename
- - the xlsb file namejava.lang.Exception
- exceptionpublic void readXLSB(java.io.InputStream in, java.lang.String pass) throws java.lang.Exception
in
- streampass
- passwordjava.lang.Exception
public void writeXLSX(java.lang.String filename) throws java.lang.Exception
filename
- - the path and filename of the excel xlsx filejava.lang.Exception
- exceptionpublic void writeXLSX(java.io.OutputStream out) throws java.lang.Exception
out
- - the OutputStreamjava.lang.Exception
- exceptionpublic void writeXML(java.io.OutputStream out) throws java.lang.Exception
out
- - the OutputStreamjava.lang.Exception
- exceptionpublic void write(java.io.OutputStream out, ExcelSaveType excelSaveType, java.lang.String password) throws java.lang.Exception
out
- - the OutputStreamexcelSaveType
- - xlsx,xlsb,xltxjava.lang.Exception
- exceptionpublic void writeXLSX(java.lang.String filename, java.lang.String password) throws java.lang.Exception
filename
- file pathpassword
- file open passwordjava.lang.Exception
- invalid argumentpublic void writeXLSX(java.io.OutputStream stream, java.lang.String password) throws java.lang.Exception
stream
- streampassword
- file open passwordjava.lang.Exception
- invalid argumentpublic void writeXLSB(java.io.OutputStream out) throws java.lang.Exception
out
- java.lang.Exception
public void writeXLSB(java.io.OutputStream stream, java.lang.String password) throws java.lang.Exception
stream
- streampassword
- file open passwordjava.lang.Exception
- invalid argumentpublic void setAutoRecalc(boolean auto)
auto
- flagpublic void getLock()
public void releaseLock()
public void setEntry(int row, int col, java.lang.String value) throws java.lang.Exception
row
- row numbercol
- column numbervalue
- cell valuejava.lang.Exception
- exceptionpublic void setEntry(int sheet, int row, int col, java.lang.String value) throws java.lang.Exception
sheet
- sheet numberrow
- row numbercol
- column numbervalue
- cell valuejava.lang.Exception
- exceptionpublic java.lang.String getFormattedText(int row, int col) throws java.lang.Exception
row
- row numbercol
- column numberjava.lang.Exception
- exceptionpublic java.lang.String getFormattedText(int sheet, int row, int col) throws java.lang.Exception
sheet
- sheet numberrow
- row numbercol
- column numberjava.lang.Exception
- exceptionpublic void sheetRangeToImage(java.lang.String fileName) throws java.lang.Exception
fileName
- output image filename in PNG formatjava.lang.Exception
- when exception occurpublic void sheetRangeToImage(int row1, int col1, int row2, int col2, java.lang.String fileName) throws java.lang.Exception
row1
- the first row in the range.col1
- the first column in the range.row2
- the ending row in the range.col2
- the ending column in the range.fileName
- output image filename in PNG formatjava.lang.Exception
- when exception occurpublic java.awt.image.BufferedImage sheetRangeToImage(int row1, int col1, int row2, int col2) throws java.lang.Exception
row1
- start rowcol1
- start colrow2
- end rowcol2
- end coljava.lang.Exception
- if there is exceptionpublic void exportPDF(java.lang.String fileName) throws java.lang.Exception
fileName
- file namejava.lang.Exception
- exceptionpublic void exportPDF(java.lang.String fileName, java.util.Map fontEncodeMap, boolean sheetOnly) throws java.lang.Exception
fileName
- file pathfontEncodeMap
- embed fontssheetOnly
- true - sheet level false - workbook leveljava.lang.Exception
- if there is exception occuredpublic void exportPDF(java.io.OutputStream outputstream) throws java.lang.Exception
outputstream
- outputstreamjava.lang.Exception
- exceptionpublic void exportPDF(java.io.OutputStream outputstream, java.util.Map fontEncodeMap, boolean sheetOnly) throws java.lang.Exception
outputstream
- sreamfontEncodeMap
- embed fontssheetOnly
- true - sheet level false - workbook leveljava.lang.Exception
- if there is exception occuredpublic void print() throws java.lang.Exception
java.lang.Exception
- exceptionpublic void print(java.awt.print.PrinterJob printJob, javax.print.attribute.PrintRequestAttributeSet printrequestattributeset) throws java.lang.Exception
printJob
- the Java PrintJob object to use.printrequestattributeset
- attributes for print jobjava.lang.Exception
- exceptionpublic void setEnableProtection(boolean enableProtection)
enableProtection
- flagpublic boolean isSheetProtected(int sheet) throws java.lang.Exception
sheet
- the number of the sheetjava.lang.Exception
- exceptionpublic void setSheetProtected(int sheet, boolean bProtected, java.lang.String password) throws java.lang.Exception
sheet
- the number of the sheetbProtected
- true = protection enabledpassword
- The protection password,this may be null if no password is to be used.java.lang.Exception
- exceptionpublic void setBookProtection(boolean bProtected, int protect, java.lang.String password) throws java.lang.Exception
bProtected
- whether protection is to be enabled.protect
- book protection options,one or more of the following:bookProtectStructurebookProtectStructure
,bookProtectWindowbookProtectWindow
password
- The protection password. this may be null if no password is to be used.java.lang.Exception
- exceptionpublic int getBookProtection()
bookProtectStructure
,bookProtectWindowbookProtectWindow
public boolean isBookProtected()
public void setSheetProtected(int sheet, int protect, java.lang.String password) throws java.lang.Exception
sheet
- the number of the sheetprotect
- sheet protection options; sheetProtectionAllowNone if nothing allowed,or one or more of the following:
sheetProtectionAllowNonesheetProtectionAllowNone
,sheetProtectionAllowEditObjects,sheetProtectionAllowEditScenarios
sheetProtectionAllowFormatCells,sheetProtectionAllowFormatColumns,sheetProtectionAllowFormatRows
sheetProtectionAllowInsertColumns,sheetProtectionAllowInsertRows,sheetProtectionAllowInsertHyperlinks
sheetProtectionAllowDeleteColumns,sheetProtectionAllowDeleteRows,sheetProtectionAllowSelectLocked
sheetProtectionAllowSort,sheetProtectionAllowUseAutoFilter,sheetProtectionAllowUsePivotRanges
sheetProtectionAllowSelectUnlocked,sheetProtectionAllowDefault,sheetProtectionAllowLockedInCellEdit
sheetProtectionAllowLockedEditFocus,sheetProtectionAllowChangeLocked,sheetProtectionAllowChangeUnlocked
sheetProtectionAllowUseOutlining,sheetProtectionAllowEverythingsheetProtectionAllowEverything
password
- The protection password,this may be null if no password is to be used.java.lang.Exception
- exceptionpublic int getSheetProtection(int sheet) throws SXException
sheet
- the number of the sheetSXException
- sheet index is invalidpublic void setFileShareProtection(java.lang.String password)
password
- password to enable file can be writepublic void setTabbedText(int row1, int col1, boolean valuesOnly, java.lang.String text) throws java.lang.Exception
row1
- starting rowcol1
- starting columnvaluesOnly
- true as unformatted texttext
- the tab-delimited textjava.lang.Exception
- if a parameter is invalidpublic void CopySheetFromBook(WorkBook m_SrcBook, int srcSheetIndex, int destSheetIndex) throws java.lang.Exception
m_SrcBook
- source view contain sheet to be copied.srcSheetIndex
- the index number of the sheet,the sheets indexed from left to right beginning with 0destSheetIndex
- the index number of the sheet,the sheets indexed from left to right beginning with 0java.lang.Exception
- if a parameter is invalid or exception occur.public void copyAllBookFrom(WorkBook wb) throws java.lang.Exception
java.lang.Exception
public void resetRowInfo(int row1, int row2) throws java.lang.Exception
row1
- start rowrow2
- end rowjava.lang.Exception
- invalid argumentpublic RangeArea getFormulaRange(java.lang.String formula)
formula
- address formulapublic void sort(int row1, int col1, int row2, int col2, boolean byRows, int key1, int key2, int key3)
row1
- first row.col1
- first column.row2
- last row.col2
- last column.byRows
- if ture,data is sorted by row.key1
- the primary key.key2
- the second key.key3
- the last key.
Positive numbers (1..n) indicate an ascending sort key.
Positive numbers (-1..-n) indicate an descending sort key.
keys are the number of the row/column,0-indicates no key.public void sort(int row1, int col1, int row2, int col2, boolean byRows, int[] keys)
row1
- first row.col1
- first column.row2
- last row.col2
- last column.byRows
- if ture,data is sorted by row.keys
- the keys to use to sort the data.
Positive numbers (1..n) indicate an ascending sort key.
negative numbers (-1..-n) indicate an descending sort key.
keys are the number of the row/column,0-indicates no key.public boolean hasAutoFilter()
public AutoFilter getAutoFilter()
public void subTotal(int row1, int col1, int row2, int col2, int changeCol, int[] subs)
row1
- first row.col1
- first column.row2
- last row.col2
- last column.changeCol
- detect each change in the column.subs
- the columns used to subtotal the data.public RangeArea find(int row1, int col1, java.lang.String text)
row1
- - cell row indexcol1
- - cell column indextext
- - search stringpublic RangeArea find(int row1, int col1, java.lang.String text, boolean matchCase, boolean matchEntire, boolean inFormula)
row1
- - cell row indexcol1
- - cell column indextext
- - search stringmatchCase
- match with case sensitivematchEntire
- match entire cellinFormula
- search in formula contentpublic void replace(java.lang.String find, java.lang.String replace)
find
- - search stringreplace
- - replace stringpublic void replace(int row1, int col1, int row2, int col2, java.lang.String find, java.lang.String replace)
public void replace(java.lang.String find, java.lang.String replace, boolean matchEntire)
find
- - search stringreplace
- - replace stringmatchEntire
- match entire cellpublic short getShowTabs()
TabsOff
- hide tabs
TabsBottomTabsBottom
- tabs on bottom
TabsTopTabsTop
- tabs on toppublic void setShowTabs(short showTabs) throws java.lang.Exception
showTabs
- the display status value which is one of the following.
TabsOffTabsOff
- hide tabs
TabsBottomTabsBottom
- tabs on bottom
TabsTopTabsTop
- tabs on topjava.lang.Exception
- exceptionpublic short getShowVScrollBar()
ShowOff
- never show.
ShowOnShowOn
- always show.
ShowAutomaticShowAutomatic
- show when appropriate.public void setShowVScrollBar(short showVScrollBar) throws java.lang.Exception
showVScrollBar
- the mode for the vertical scroll bar:
ShowOffShowOff
- never show.
ShowOnShowOn
- always show.
ShowAutomaticShowAutomatic
- show when appropriate.java.lang.Exception
- exceptionpublic short getShowHScrollBar()
ShowOff
- never show.
ShowOnShowOn
- always show.
ShowAutomaticShowAutomatic
- show when appropriate.public void setShowHScrollBar(short showHScrollBar) throws java.lang.Exception
showHScrollBar
- the mode for the horizontal scroll bar:
ShowOffShowOff
- never show.
ShowOnShowOn
- always show.
ShowAutomaticShowAutomatic
- show when appropriate.java.lang.Exception
- exceptionpublic boolean isShowZeroValues()
public void setShowZeroValues(boolean showZeroValues)
showZeroValues
- true if show zero values.public void setWorkbookName(java.lang.String name)
name
- workbook namepublic void setGroup(java.lang.String name) throws java.lang.Exception
name
- group namejava.lang.Exception
- if there is exception occuredpublic void setDefaultFontName(java.lang.String name)
name
- font namepublic void quitGroup() throws java.lang.Exception
java.lang.Exception
- if there is exception occuredpublic void dispose()
public int getSheetTabColor()
public void setSheetTabColor(java.awt.Color color)
color
- java.awt.color objectpublic int getSheetViewType()
public void setSheetViewType(int viewType)
viewType
- the sheet view type:
0 - Normal view
1 - Page Layout View
2 - Page break previewpublic void clearCell(int row, int col)
row
- - cell row indexcol
- - cell column indexpublic void setCSVSeparator(char c)
c
- seprator charpublic char getCSVSeparator()
public void setShowOutlines(boolean t)
t
- true shownpublic void setDocPropParsing(boolean b)
b
- true to allow parsingpublic BuiltInDocumentProperties getBuiltInDocumentProperties()
public CustomDocumentProperties getCustomDocumentProperties()
public Table addTable(java.lang.String tableName, int row1, int col1, int row2, int col2, TableBuiltInStyles builtInTableStyle)
tableName
- name of the tablerow1
- start rowcol1
- start colrow2
- end rowcol2
- end colbuiltInTableStyle
- buildin table stylepublic Table getTable(int row1, int col1)
row1
- start rowcol1
- start colpublic void CreateTableStyle(java.lang.String tableStyleName, java.util.HashMap<com.smartxls.enums.TableStyleElementType,RangeStyle> tableStyleElements)
tableStyleName
- name of the tablestyletableStyleElements
- map of the table style element partspublic java.lang.Object getSheetProperty(SheetVarType varType)
varType
- enum value of com.smartxls.SheetVarTypepublic boolean isSheetRightToLeft()
public void setSheetRightToLeft(boolean flag)
flag
- true right to leftpublic boolean isCalcOnSave()
public void setCalcOnSave(boolean flag)
flag
- true to calculated on savingpublic ExcelVersion getWorkBookVersion()
public void setWorkBookVersion(ExcelVersion ver)
public java.lang.String getVersionString()