public interface WorkBook extends Handle, Document
| Modifier and Type | Field and Description |
|---|---|
static int |
ALLOWDUPES |
static String |
CALC_MODE_PROP |
static int |
CALCULATE_ALWAYS |
static int |
CALCULATE_AUTO |
static int |
CALCULATE_EXPLICIT |
static String |
DEFAULTENCODING |
static String |
REFTRACK_PROP |
static int |
SHAREDUPES |
static int |
STRING_ENCODING_AUTO |
static int |
STRING_ENCODING_COMPRESSED |
static int |
STRING_ENCODING_UNICODE |
static String |
UNICODEENCODING |
static String |
USETEMPFILE_PROP |
static String |
VALIDATEWORKBOOK |
DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String name,
Object val)
add non-Excel property
|
boolean |
addSheetFromWorkBook(WorkBookHandle sourceBook,
String sourceSheetName,
String destSheetName)
Inserts a worksheet from a Source WorkBook.
|
WorkSheetHandle |
addWorkSheet(WorkSheetHandle sht,
String NewSheetName)
Inserts a new worksheet and places it at the end of the workbook
|
void |
calculateFormulas()
Iterate through the formulas in this WorkBook and call the
calculate method on each.
|
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
|
WorkSheetHandle |
createWorkSheet(String name)
Creates a new worksheet and places it at the end of the workbook
|
byte[] |
getBytes()
Returns a byte Array containing the
valid file containing this WorkBook
and associated Storages (such as VB files
and PivotTables.)
This is the actual file data and that can be
read from and written to FileOutputStreams and
ServletOutputStreams.
|
CellHandle |
getCell(String address)
Returns the Cell at the specified Location
|
CellHandle[] |
getCells()
Returns all of the Cells contained in the WorkBook
|
ChartHandle |
getChart(String chartname)
Returns a Chart Handle
|
ChartHandle[] |
getCharts()
Returns all Chart Handles contained in the WorkBook
|
Color[] |
getColorTable()
The Session for the WorkBook instance
|
DateConverter.DateFormat |
getDateFormat()
Gets the date format used by this book.
|
FormatHandle[] |
getFormats()
Returns an Array of all the FormatHandles present in the workbook
|
int |
getFormulaCalculationMode() |
String |
getName()
Returns the name of this WorkBook
|
NameHandle |
getNamedRange(String rangename)
Returns a Named Range Handle
|
NameHandle[] |
getNamedRanges()
Returns all Named Range Handles
|
WorkBookHandle |
getNoSheetWorkBook()
Returns a WorkBookHandle containing an empty
version of this WorkBook.
|
int |
getNumCells()
Returns the number of Cells 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
|
Object |
getProperty(String name)
get a non-Excel property
|
WorkBook |
getWorkBook()
Returns a low-level WorkBook.
|
WorkSheetHandle |
getWorkSheet(int i)
returns the handle to a WorkSheet by name.
|
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.
|
void |
removeAllWorkSheets()
Removes all of the WorkSheets from this WorkBook.
|
void |
reset()
Clears all values in a template WorkBook.
|
void |
setDebugLevel(int l)
Set the Debugging level.
|
void |
setDefaultColWidth(int t)
set Default col width
Note: only affects undefined Columns containing Cells
|
void |
setDefaultRowHeight(int t)
set Default row height
Note: only affects undefined Rows containing Cells
|
void |
setDupeStringMode(int mode)
Set Duplicate String Handling Mode.
|
void |
setFormulaCalculationMode(int mode)
Explicit calcing of formulas
|
void |
setName(String nm)
Sets the internal name of this WorkBookHandle.
|
void |
setProtected(boolean b)
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 |
setStringEncodingMode(int mode)
Set Encoding mode of new Strings added to file.
|
String |
toString()
Returns the name of this Sheet.
|
StringBuffer |
writeBytes(OutputStream bbout) |
static final int CALCULATE_ALWAYS
static final int CALCULATE_EXPLICIT
static final int CALCULATE_AUTO
static final String CALC_MODE_PROP
static final String REFTRACK_PROP
static final String USETEMPFILE_PROP
static final String DEFAULTENCODING
static final String UNICODEENCODING
static final String VALIDATEWORKBOOK
static final int STRING_ENCODING_AUTO
static final int STRING_ENCODING_UNICODE
static final int STRING_ENCODING_COMPRESSED
static final int ALLOWDUPES
static final int SHAREDUPES
void setFormulaCalculationMode(int mode)
mode - int getFormulaCalculationMode()
Object getProperty(String name)
getProperty in interface Documentvoid addProperty(String name, Object val)
addProperty in interface Documentproperties - The properties to set.Color[] getColorTable()
CellHandle[] getCells()
CellHandle getCell(String address) throws CellNotFoundException, WorkSheetNotFoundException
address - CellNotFoundExceptionWorkSheetNotFoundExceptionFormatHandle[] getFormats()
DateConverter.DateFormat getDateFormat()
PivotTableHandle getPivotTable(String ptname) throws PivotTableNotFoundException
String - name of the PivotTablePivotTableNotFoundExceptionPivotTableHandle[] getPivotTables() throws PivotTableNotFoundException
PivotTableNotFoundExceptionvoid setProtected(boolean b)
int - Default Column widthvoid setDefaultRowHeight(int t)
int - Default Row Heightvoid setDefaultColWidth(int t)
int - Default Column widthvoid setName(String nm)
void setDebugLevel(int l)
setDebugLevel in interface DocumentNameHandle getNamedRange(String rangename) throws CellNotFoundException
CellNotFoundExceptionChartHandle getChart(String chartname) throws ChartNotFoundException
ChartNotFoundExceptionChartHandle[] getCharts()
NameHandle[] getNamedRanges()
String getName()
int getNumCells()
byte[] getBytes()
WorkSheetHandle[] getWorkSheets()
WorkSheetHandle getWorkSheet(int i) throws WorkSheetNotFoundException
index - of worksheet (ie: 0)WorkSheetNotFoundException - if the specified WorkSheet is
not found in the WorkBook.WorkSheetHandle getWorkSheet(String handstr) throws WorkSheetNotFoundException
String - name of worksheet (ie: "Sheet1")WorkSheetNotFoundException - if the specified WorkSheet is
not found in the WorkBook.WorkBook getWorkBook()
void reset()
void setStringEncodingMode(int mode)
int - String Encoding Modevoid setDupeStringMode(int mode)
int - Duplicate String Handling Modevoid copyChartToSheet(String chartname, String sheetname) throws ChartNotFoundException, WorkSheetNotFoundException
chartname - sheetname - ChartNotFoundExceptionWorkSheetNotFoundExceptionvoid copyChartToSheet(ChartHandle chart, WorkSheetHandle sheet) throws ChartNotFoundException, WorkSheetNotFoundException
chart - sheet - ChartNotFoundExceptionWorkSheetNotFoundExceptionWorkSheetHandle copyWorkSheet(String SourceSheetName, String NewSheetName) throws WorkSheetNotFoundException
String - the Name of the source worksheet;String - the Name of the new (destination) worksheet;WorkSheetNotFoundExceptionvoid calculateFormulas()
throws FunctionNotSupportedException
FunctionNotSupportedExceptionvoid removeAllWorkSheets()
WorkBookHandle getNoSheetWorkBook()
addSheetFromWorkBookboolean addSheetFromWorkBook(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 workbookWorkSheetNotFoundExceptionWorkSheetHandle addWorkSheet(WorkSheetHandle sht, String NewSheetName)
WorkSheetHandle - the source WorkSheetHandle;String - the Name of the new (destination) worksheet;WorkSheetHandle createWorkSheet(String name)
String - the Name of the newly created worksheetString toString()
toString in class ObjectObject.toString()StringBuffer writeBytes(OutputStream bbout)
Copyright © 2002–2019 Starter Inc.. All rights reserved.