public class WorkBookHandle extends DocumentHandle implements WorkBook, Handle
WorkBookHandle book = new WorkBookHandle("testxls.xls");
WorkSheetHandle sheet = book.getWorkSheet("Sheet1");
CellHandle cell = sheet.getCell("B22");
By default, OpenXLS will lock open WorkBook files. To close the file after
parsing and work with a temporary file instead, use the following setting:
System.getProperties().put(WorkBookHandle.USETEMPFILE, "true");
If you enable this mode you will need to periodically clean up the generated
temporary files in your working directory. All OpenXLS temporary file names
begin with "ExtenXLS_".
| Modifier and Type | Field and Description |
|---|---|
static String |
CONVERTMULBLANKS
This is
|
static Writer |
dump_input
A Writer to which a record dump should be written on input.
|
static int |
FORMAT_XLS
Format constant for BIFF8 (Excel '97-2007).
|
static int |
FORMAT_XLSM
Format constant for macro-enabled OOXML (Excel 2007).
|
static int |
FORMAT_XLSX
Format constant for normal OOXML (Excel 2007).
|
static int |
FORMAT_XLTM
Format constant for macro-enabled OOXML template (Excel 2007).
|
static int |
FORMAT_XLTX
Format constant for OOXML template (Excel 2007).
|
protected WorkBook |
mybook |
protected WorkBookFactory |
myfactory |
protected LEOFile |
myLEOFile |
protected ProgressListener |
plist |
static int |
RECURSION_LEVELS_ALLOWED
How many recursion levels to allow formulas to be calculated before throwing
a circular reference error
|
static SimpleDateFormat |
simpledateformat |
DEBUGLEVEL, file, FORMAT_NATIVE, name, workingdirALLOWDUPES, CALC_MODE_PROP, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, DEFAULTENCODING, REFTRACK_PROP, SHAREDUPES, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE, UNICODEENCODING, USETEMPFILE_PROP, VALIDATEWORKBOOKDEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM| Modifier | Constructor and Description |
|---|---|
|
WorkBookHandle()
Default constructor creates a new, empty Spreadsheet with
3 WorkSheets: "Sheet1","Sheet2",and "Sheet3".
|
|
WorkBookHandle(boolean Excel2007)
Constructor creates a new, empty Spreadsheet with 3 worksheets: "Sheet1",
"Sheet2" and "Sheet3"
This version allows flagging the workbook as Excel 2007 format. |
|
WorkBookHandle(byte[] barray)
Create a new WorkBookHandle from the byte array passed in.
|
|
WorkBookHandle(File fx)
constructor which takes the XLS file
|
|
WorkBookHandle(InputStream inx)
constructor which takes an InputStream containing the bytes of a valid XLS
file.
|
protected |
WorkBookHandle(LEOFile leo)
For internal creation of a workbook handle from
|
|
WorkBookHandle(ProgressListener pn)
Constructor which takes a ProgressListener which monitors the progress of
creating a new Excel file.
|
|
WorkBookHandle(String filePath)
Constructor which takes the XLS file name(
|
|
WorkBookHandle(String filePath,
int debug)
constructor which takes the XLS file name and has an optional debug setting
to assist with output.
|
|
WorkBookHandle(String fname,
ProgressListener pn)
Constructor which takes the XLS file name
and a ProgressListener which monitors the progress of reading the Excel file.
|
|
WorkBookHandle(URL url)
Fetches a workbook from a URL
If you need to authenticate your URL connection first then use the
InputStream constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSheetFromWorkBook(WorkBookHandle sourceBook,
String sourceSheetName,
String destSheetName)
Deprecated.
- use addWorkSheet(WorkSheetHandle sht, String NewSheetName){
|
boolean |
addSheetFromWorkBookWithFormatting(WorkBookHandle sourceBook,
String sourceSheetName,
String destSheetName)
Deprecated.
- use addWorkSheet(WorkSheetHandle sht, String NewSheetName){
|
WorkSheetHandle |
addWorkSheet(WorkSheetHandle sourceSheet)
Inserts a WorkSheetHandle from a separate WorkBookhandle into the current
WorkBookHandle.
|
WorkSheetHandle |
addWorkSheet(WorkSheetHandle sourceSheet,
String NewSheetName)
Inserts a WorkSheetHandle from a separate WorkBookhandle into the current
WorkBookHandle.
|
void |
calculateFormulas()
Forces immediate recalculation of every formula in the workbook.
|
void |
close()
Closes the WorkBook and releases resources.
|
void |
copyChartToSheet(ChartHandle chart,
WorkSheetHandle sheet)
Copies an existing Chart to another WorkSheet
|
void |
copyChartToSheet(String chartname,
String sheetname)
Copies an existing Chart to another WorkSheet
|
WorkSheetHandle |
copyWorkSheet(String SourceSheetName,
String NewSheetName)
Copy (duplicate) a worksheet in the workbook and add it to the end of the
workbook with a new name
|
ChartHandle |
createChart(String name,
WorkSheetHandle wsh)
Creates a new Chart and places it at the end of the workbook
|
NameHandle |
createNamedRange(String name,
String rangeDef)
Create a named range in the workbook
Note that the named range designation can conform to excel specs, that is,
boolean values, references, or string variables can be set.
|
WorkSheetHandle |
createWorkSheet(String name)
Creates a new worksheet and places it at the end of the workbook.
|
WorkSheetHandle |
createWorkSheet(String name,
int sheetpos)
Creates a new worksheet and places it at the specified position.
|
void |
deleteChart(String chartname,
WorkSheetHandle wsh)
delete an existing chart of the workbook
|
protected void |
finalize() |
WorkSheetHandle |
getActiveSheet()
returns the active or selected worksheet tab
|
String[] |
getAllStrings()
Returns all strings that are in the SharedStringTable for this workbook.
|
byte[] |
getBytes()
Deprecated.
Writing the spreadsheet to a byte array uses a great deal of
memory and generally provides no benefit over streaming output.
Use the
write(java.lang.String) family of methods instead. If you need a
byte array use ByteArrayOutputStream. |
CellHandle |
getCell(String address)
Returns the Cell at the specified Location
|
CellRange[] |
getCellRanges()
Returns an Array of the CellRanges existing in this WorkBook specifically the
Ranges referenced in Formulas, Charts, and Named Ranges.
|
CellHandle[] |
getCells()
Returns an array containing all cells in the WorkBook
|
ChartHandle |
getChart(String chartname)
Returns a Chart Handle
|
ChartHandle |
getChartById(int id)
retrieve a ChartHandle via id
|
ChartHandle[] |
getCharts()
Returns all Chart Handles contained in the WorkBook
|
Color[] |
getColorTable()
Get either the default color table, or the color table from the custom
palatte(if exists) from the WorkBook
|
FormatHandle[] |
getConditionalFormats()
Returns an array of all Conditional Formats in the workbook
these are formats referenced and used by the conditionally formatted ranges
in the workbook.
|
DateConverter.DateFormat |
getDateFormat()
Gets the date format used by this book.
|
WorkBookFactory |
getFactory()
Gets the internal Factory object.
|
String |
getFileExtension()
Gets the file name extension for this document's native format.
|
int |
getFormat()
Gets the constant representing this document's native format.
|
int |
getFormat(String path)
Gets the constant representing this document's desired format
|
FormatHandle[] |
getFormats()
Returns an array of all FormatHandles in the workbook
|
int |
getFormulaCalculationMode()
Get the calculation mode for the workbook.
|
FormulaHandle |
getFormulaHandle(String celladdress)
Returns a Formula Handle
|
ImageHandle |
getImage(String imagename)
Returns an ImageHandle for manipulating images in the WorkBook
|
ImageHandle[] |
getImages()
Returns all ImageHandles in the workbook
|
boolean |
getIsExcel2007()
Returns whether the underlying spreadsheet is in Excel 2007 format by
default.
|
LEOFile |
getLEOFile()
Gets the internal LEOFile object.
|
String |
getName()
Returns the name of this WorkBook
|
NameHandle |
getNamedRange(String rangename)
Returns a Named Range Handle
|
NameHandle |
getNamedRangeInScope(String rangename)
Returns a Named Range Handle if it exists in the specified scope.
|
NameHandle[] |
getNamedRanges()
Returns all Named Range Handles
|
NameHandle[] |
getNamedRangesInScope()
Returns all Named Range Handles scoped to WorkBook.
|
WorkBookHandle |
getNoSheetWorkBook()
Returns a WorkBookHandle containing an empty version of this WorkBook.
|
int |
getNumCells()
Returns the number of Cells in this WorkBook
|
int |
getNumWorkSheets()
Returns the number of Sheets in this WorkBook
|
PivotTableHandle |
getPivotTable(String ptname)
get a handle to a PivotTable in the WorkBook
|
PivotTableHandle[] |
getPivotTables()
get an array of handles to all PivotTables in the WorkBook
|
protected static byte[] |
getPrototypeBook() |
protected static byte[] |
getPrototypeChart() |
protected static byte[] |
getPrototypeSheet() |
String |
getStats()
Return useful statistics about this workbook.
|
String |
getStats(boolean usehtml)
Return useful statistics about this workbook.
|
WorkBook |
getWorkBook()
Returns a low-level WorkBook.
|
String |
getWorkingDirectory() |
WorkSheetHandle |
getWorkSheet(int sheetnum)
returns the handle to a WorkSheet by number.
|
WorkSheetHandle |
getWorkSheet(String handstr)
returns the handle to a WorkSheet by name.
|
WorkSheetHandle[] |
getWorkSheets()
Returns an array of handles to all of the WorkSheets in the Workbook.
|
String |
getXLSVersionString()
Returns the lowest version of Excel compatible with the input file.
|
protected void |
initBytes(BlockByteReader blockByteReader)
init the new WorkBookHandle
|
protected void |
initDefault()
another handle to the useful ability to load a book from the prorotype bytes
|
protected void |
initFromFile(File fx)
do all initialization with a filename
|
protected void |
initFromStream(InputStream input)
Initialize this workbook from a stream, unfortunately our byte backer
requires a file, so create a tempfile and init from that
|
protected void |
initializeFromByteArray(byte[] barray)
Protected method that handles WorkBookHandle(byte[]) constructor
|
void |
initSharedFormulas() |
protected void |
initWorkBookFactory() |
boolean |
is1904()
Deprecated.
Use
getDateFormat() instead. |
void |
markFormulasDirty()
Marks every formula in the workbook as needing a recalc.
|
void |
recalc()
Recalculates all dirty formulas in the workbook immediately.
|
void |
removeAllWorkSheets()
Removes all of the WorkSheets from this WorkBook.
|
void |
reset()
Resets the document state to what it was when it was loaded.
|
int |
searchAndReplace(String searchfor,
String replacewith)
Searches all Cells in the workbook for the string occurrence and replaces
with the replacement text.
|
void |
setDefaultColWidth(int t)
Set the default column width across all worksheets
This setting is a worksheet level setting, so will be applied to all existing worksheets. |
void |
setDefaultRowHeight(int t)
set Default row height in twips (=1/20 of a point)
Note: only affects undefined Rows containing Cells
|
void |
setDupeStringMode(int mode)
Set Duplicate String Handling Mode.
|
void |
setFormulaCalculationMode(int CalcMode)
Set the calculation mode for the workbook.
|
static void |
setFormulaRecursionLevels(int recursion_allowed)
Set the recursion levels allowed for formulas calculated in this workbook
before a circular reference is thrown.
|
void |
setIsExcel2007(boolean isExcel2007)
Sets whether this Workbook is in Excel 2007 format.
|
void |
setProtected(boolean protect)
set the workbook to protected mode
Note: the password cannot be decrypted or changed in Excel -- protection can
only be set/removed using OpenXLS
|
void |
setShowSheetTabs(boolean show)
Sets whether the sheet selection tabs should be shown.
|
void |
setStringEncodingMode(int mode)
Set Encoding mode of new Strings added to file.
|
boolean |
showSheetTabs()
Returns whether the sheet selection tabs should be shown.
|
FormatHandle |
transferExternalFormatHandle(FormatHandle externalFormat)
Utility method to copy a format handle from a separate WorkBookHandle to this
WorkBookHandle
|
void |
write(OutputStream dest,
boolean ooxml)
Deprecated.
The boolean format parameter is not flexible enough to represent
all supported formats. Use
write(OutputStream,int)
instead. |
void |
write(OutputStream dest,
int format)
Writes the document to the given stream in the requested format.
|
void |
write(String path)
Deprecated.
The filename-based format choosing is counter-intuitive and
failure-prone. Use
write(OutputStream,int) instead. |
void |
write(String path,
boolean ooxml)
Deprecated.
The boolean format parameter is not flexible enough to represent
all supported formats. Use
DocumentHandle.write(File,int) instead. |
StringBuffer |
writeBytes(OutputStream dest)
Deprecated.
Use
write(OutputStream,int) instead. |
void |
writeXLSXBytes(OutputStream dest)
Deprecated.
Use
#write(OutputStream,int) instead. |
void |
writeXLSXBytes(OutputStream dest,
int format)
Deprecated.
This method is like
write(OutputStream,int) except it
only supports OOXML formats. Use that instead. |
addProperty, getDebugLevel, getFile, getFileFromURL, getFileName, getInstance, getProperties, getProperty, getVersion, setDebugLevel, setFile, setFileName, setName, setProperties, setStreamingSheets, toString, write, write, writeclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddProperty, getProperty, setDebugLevel, setName, toStringpublic static Writer dump_input
protected WorkBook mybook
protected LEOFile myLEOFile
protected WorkBookFactory myfactory
protected ProgressListener plist
public static final int FORMAT_XLS
public static final int FORMAT_XLSX
public static final int FORMAT_XLSM
public static final int FORMAT_XLTX
public static final int FORMAT_XLTM
public static SimpleDateFormat simpledateformat
public static int RECURSION_LEVELS_ALLOWED
public static String CONVERTMULBLANKS
public WorkBookHandle()
public WorkBookHandle(boolean Excel2007)
boolean - Excel2007 - true if set to Excel 2007 versionpublic WorkBookHandle(InputStream inx)
InputStream - contains the valid BIFF8 bytes for readingpublic WorkBookHandle(byte[] barray)
byte[] - byte array containing the valid XLS or XLSX file for readingpublic WorkBookHandle(URL url)
urlx - Exceptionpublic WorkBookHandle(String filePath)
String - filePath the name of the XLS file to readpublic WorkBookHandle(String filePath, int debug)
String - filePath the name of the XLS file to readDebug - levelpublic WorkBookHandle(File fx)
File - the XLS file to readDebug - levelpublic WorkBookHandle(ProgressListener pn)
ProgressListener - object which is monitoring progress of WorkBook readpublic WorkBookHandle(String fname, ProgressListener pn)
String - fname the name of the XLS file to readProgressListener - object which is monitoring progress of WorkBook readprotected WorkBookHandle(LEOFile leo)
leo - protected static byte[] getPrototypeBook()
throws IOException
IOExceptionprotected static byte[] getPrototypeSheet()
protected static byte[] getPrototypeChart()
public WorkBookFactory getFactory()
WARNING: This method is not part of the public API. Its use is not supported and behavior is subject to change.
public LEOFile getLEOFile()
WARNING: This method is not part of the public API. Its use is not supported and behavior is subject to change.
public int searchAndReplace(String searchfor, String replacewith)
public String[] getAllStrings()
public Color[] getColorTable()
getColorTable in interface WorkBook@Deprecated public boolean is1904()
getDateFormat() instead.public DateConverter.DateFormat getDateFormat()
getDateFormat in interface WorkBookpublic String getXLSVersionString()
public String getStats(boolean usehtml)
use - html line breakspublic String getStats()
public CellHandle getCell(String address) throws CellNotFoundException, WorkSheetNotFoundException
getCell in interface WorkBookaddress - CellNotFoundExceptionWorkSheetNotFoundExceptionpublic CellRange[] getCellRanges()
public PivotTableHandle getPivotTable(String ptname) throws PivotTableNotFoundException
getPivotTable in interface WorkBookString - name of the PivotTablePivotTableNotFoundExceptionpublic PivotTableHandle[] getPivotTables() throws PivotTableNotFoundException
getPivotTables in interface WorkBookPivotTableNotFoundExceptionpublic void setFormulaCalculationMode(int CalcMode)
setFormulaCalculationMode in interface WorkBookCalcMode - Calculation mode to use in workbook.public int getFormulaCalculationMode()
getFormulaCalculationMode in interface WorkBookCalcMode - Calculation mode to use in workbook.public void setProtected(boolean protect)
setProtected in interface WorkBookboolean - whether to protect the bookpublic void setDefaultRowHeight(int t)
setDefaultRowHeight in interface WorkBookint - Default Row Heightpublic void setDefaultColWidth(int t)
setDefaultColWidth in interface WorkBookpublic FormulaHandle getFormulaHandle(String celladdress) throws FormulaNotFoundException
FormulaNotFoundExceptionpublic ImageHandle[] getImages()
public ImageHandle getImage(String imagename) throws ImageNotFoundException
imagename - ImageNotFoundExceptionpublic NameHandle getNamedRange(String rangename) throws CellNotFoundException
getNamedRange in interface WorkBookCellNotFoundExceptionpublic NameHandle getNamedRangeInScope(String rangename) throws CellNotFoundException
CellNotFoundExceptionpublic NameHandle createNamedRange(String name, String rangeDef)
name - The name that should be used to reference this named rangerangeDef - Range of the cells for this named range, in excel syntax including
sheet name, ie "Sheet1!A1:D1"public ChartHandle getChart(String chartname) throws ChartNotFoundException
getChart in interface WorkBookChartNotFoundExceptionpublic ChartHandle[] getCharts()
public ChartHandle getChartById(int id) throws ChartNotFoundException
id - ChartNotFoundExceptionpublic NameHandle[] getNamedRanges()
getNamedRanges in interface WorkBookpublic NameHandle[] getNamedRangesInScope()
public String getName()
public CellHandle[] getCells()
public int getNumCells()
getNumCells in interface WorkBookpublic boolean showSheetTabs()
public void setShowSheetTabs(boolean show)
@Deprecated public byte[] getBytes()
write(java.lang.String) family of methods instead. If you need a
byte array use ByteArrayOutputStream.@Deprecated public void write(String path)
write(OutputStream,int) instead.path - the path to which the document should be written@Deprecated public void write(String path, boolean ooxml)
DocumentHandle.write(File,int) instead.path - the path to which the document should be writtenooxml - If true, write as OOXML (XLSX). Otherwise, write as
BIFF8 (XLS).@Deprecated public void write(OutputStream dest, boolean ooxml)
write(OutputStream,int)
instead.dest - the stream to which the document should be writtenooxml - If true, write as OOXML (XLSX). Otherwise, write as
BIFF8 (XLS).public int getFormat()
getFormat in class DocumentHandlepublic int getFormat(String path)
public String getFileExtension()
DocumentHandlegetFileExtension in class DocumentHandlepublic void write(OutputStream dest, int format) throws IOException
format choices:
WorkBookHandle.FORMAT_XLS for 2003 and previous versions
WorkBookHandle.FORMAT_XLSX for non-macro-enabled 2007 version
WorkBookHandle.FORMAT_XLSM for macro-enabled 2007 version
WorkBookHandle.FORMAT_XLTM for macro-enabled 2007 templates.
WorkBookHandle.FORMAT_XLTX for 2007 templates,
IMPORTANT NOTE: if the resulting filename contains the .XLSM extension
the WorkBook MUST be written in FORMAT_XLSM; otherwise open errors
will occur
NOTE: If the format is FORMAT_XLSX and the filename contains macros
the file will be written as Macro-Enabled i.e. in FORMAT_XLSM. In these
cases,
the filename must contain the .XLSM extension
write in interface Documentwrite in class DocumentHandledest - the stream to which the document should be writtenformat - the constant representing the desired output formatIllegalArgumentException - if the given type code is invalidIOException - if an error occurs while writing to the stream@Deprecated public void writeXLSXBytes(OutputStream dest, int format) throws Exception
write(OutputStream,int) except it
only supports OOXML formats. Use that instead.dest - the stream to which the document should be writtenformat - the constant representing the desired output formatIllegalArgumentException - if the given type code is invalidIOException - if an error occurs while writing to the streamException@Deprecated public void writeXLSXBytes(OutputStream dest) throws Exception
#write(OutputStream,int) instead.dest - the stream to which the document should be writtenIOException - if an error occurs while writing to the streamExceptionpublic boolean getIsExcel2007()
public void setIsExcel2007(boolean isExcel2007)
isExcel2007 - @Deprecated public StringBuffer writeBytes(OutputStream dest)
write(OutputStream,int) instead.
To output a debugging StringBuffer, you must first set the
autolockdown setting:
props.put("io.starter.OpenXLS.autocreatelockdown","true");
writeBytes in interface WorkBookdest - the stream to which the document should be writtenprotected void initDefault()
protected void initFromStream(InputStream input)
protected void initializeFromByteArray(byte[] barray)
barray - protected void initWorkBookFactory()
protected void initFromFile(File fx)
fname - protected void initBytes(BlockByteReader blockByteReader)
public void close()
close in interface Closeableclose in interface AutoCloseableprotected void finalize()
throws Throwable
public void reset()
DocumentHandlepublic WorkSheetHandle[] getWorkSheets()
getWorkSheets in interface WorkBookpublic WorkSheetHandle getWorkSheet(int sheetnum) throws WorkSheetNotFoundException
getWorkSheet in interface WorkBookindex - of worksheet (ie: 0)WorkSheetNotFoundException - if the specified WorkSheet is not found in the WorkBook.public WorkSheetHandle getWorkSheet(String handstr) throws WorkSheetNotFoundException
getWorkSheet in interface WorkBookString - name of worksheet (ie: "Sheet1")WorkSheetNotFoundException - if the specified WorkSheet is not found in the WorkBook.public WorkSheetHandle getActiveSheet() throws WorkSheetNotFoundException
WorkSheetNotFoundExceptionpublic WorkBook getWorkBook()
getWorkBook in interface WorkBookpublic void setStringEncodingMode(int mode)
setStringEncodingMode in interface WorkBookint - String Encoding Modepublic void setDupeStringMode(int mode)
The Duplicate String Mode determines the behavior of
the String table when inserting new Strings.
The String table shares a single entry for multiple
Cells containing the same string. When multiple Cells
have the same value, they share the same underlying string.
Changing the value of any one of the Cells will change
the value for any Cells sharing that reference.
For this reason, you need to determine
the handling of new strings added to the sheet that
are duplicates of strings already in the table.
If you will be changing the values of these
new Cells, you will need to set the Duplicate
String Mode to ALLOWDUPES. If the string table
encounters a duplicate entry being added, it
will insert a duplicate that can then be subsequently
changed without affecting the other duplicate Cells.
Valid Modes Are:
WorkBookHandle.ALLOWDUPES - faster String inserts, larger file sizes, changing Cells has no effect on dupe Cells
WorkBookHandle.SHAREDUPES - slower inserts, dupe smaller file sizes, Cells share changes
setDupeStringMode in interface WorkBookint - Duplicate String Handling Modepublic void copyChartToSheet(String chartname, String sheetname) throws ChartNotFoundException, WorkSheetNotFoundException
copyChartToSheet in interface WorkBookchartname - sheetname - ChartNotFoundExceptionWorkSheetNotFoundExceptionpublic void copyChartToSheet(ChartHandle chart, WorkSheetHandle sheet) throws ChartNotFoundException, WorkSheetNotFoundException
copyChartToSheet in interface WorkBookchart - sheet - ChartNotFoundExceptionWorkSheetNotFoundExceptionpublic WorkSheetHandle copyWorkSheet(String SourceSheetName, String NewSheetName) throws WorkSheetNotFoundException
copyWorkSheet in interface WorkBookString - the Name of the source worksheet;String - the Name of the new (destination) worksheet;WorkSheetNotFoundExceptionpublic void calculateFormulas()
calculateFormulas in interface WorkBookFunctionNotSupportedException - if an unsupported function is used by any formula in the workbook#forceRecalc(),
recalc()public void markFormulasDirty()
recalc().public void recalc()
You generally need not call this method. Dirty formulas will automatically be recalculated when their values are queried. This method is only useful for forcing calculation to occur at a certain time. In the case of functions such as NOW() whose value is volatile the formula will still be recalculated every time it is queried.
FunctionNotSupportedException - if an unsupported function is used by any formula in the workbookmarkFormulasDirty()public void removeAllWorkSheets()
removeAllWorkSheets in interface WorkBookpublic WorkBookHandle getNoSheetWorkBook()
getNoSheetWorkBook in interface WorkBookaddSheetFromWorkBook@Deprecated public boolean addSheetFromWorkBook(WorkBookHandle sourceBook, String sourceSheetName, String destSheetName) throws WorkSheetNotFoundException
addSheetFromWorkBook in interface WorkBooksourceBook - - the WorkBook containing the sheet to copysourceSheetName - - the name of the sheet to copydestSheetName - - the name of the new sheet in this workbookWorkSheetNotFoundException@Deprecated public boolean addSheetFromWorkBookWithFormatting(WorkBookHandle sourceBook, String sourceSheetName, String destSheetName) throws WorkSheetNotFoundException
sourceBook - - the WorkBook containing the sheet to copysourceSheetName - - the name of the sheet to copydestSheetName - - the name of the new sheet in this workbookWorkSheetNotFoundExceptionpublic WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet)
WorkSheetHandle - the source WorkSheetHandle;public WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet, String NewSheetName)
addWorkSheet in interface WorkBookWorkSheetHandle - the source WorkSheetHandle;String - the Name of the new (destination) worksheet;public FormatHandle transferExternalFormatHandle(FormatHandle externalFormat)
externalFormat - - FormatHandle from an external WorkBookHandlepublic ChartHandle createChart(String name, WorkSheetHandle wsh)
String - the Name of the newly created Chartpublic void deleteChart(String chartname, WorkSheetHandle wsh) throws ChartNotFoundException
chartname - ChartNotFoundExceptionpublic int getNumWorkSheets()
public WorkSheetHandle createWorkSheet(String name, int sheetpos)
name - the name of the newly created worksheetsheetpos - the index at which the sheet should be insertedpublic WorkSheetHandle createWorkSheet(String name)
createWorkSheet in interface WorkBookname - the name of the newly created worksheetpublic FormatHandle[] getFormats()
getFormats in interface WorkBookpublic FormatHandle[] getConditionalFormats()
public static void setFormulaRecursionLevels(int recursion_allowed)
recursion_allowed - public String getWorkingDirectory()
public void initSharedFormulas()
Copyright © 2002–2019 Starter Inc.. All rights reserved.