|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenXLS.DocumentHandle
com.extentech.ExtenXLS.WorkBookHandle
public class WorkBookHandle
The WorkBookHandle provides a handle to the XLS file and includes
convenience methods for working with the WorkSheets and Cell values within
the XLS file. For example:
WorkBookHandle book = new WorkBookHandle("testxls.xls");
WorkSheetHandle sheet = book.getWorkSheet("Sheet1");
CellHandle cell = sheet.getCell("B22");
In order to improve usability ExtenXLS will convert the internal Excel
'Mulblank' record type to the 'Blank' record type when parsing the file.
The Blank records are used by Excel when there are empty Cells which have
formatting information. The conversion allows setting of values on Blank
cells without adding or deleting values. You may wish to disable this
feature to improve performance. To do so, use the following:
System.getProperties().put(WorkBookHandle.CONVERTMULBLANKS, "false");
By default, ExtenXLS 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 ExtenXLS temporary file names
begin with "ExtenXLS_".
Due to issues on a number of application server platforms, ExtenXLS may be unable to find required resources automatically. These include the location of the license file and the default templates for new WorkBookHandles and WorkSheetHandles.
These issues are easily resolved by setting the system properties "com.extentech.ExtenXLS.licensekey" and "com.extentech.ExtenXLS.jarloc". These should contain the license key and the fully-qualified path to the ExtenXLS JAR, respectively.
If your environment provides a mechanism for setting Java system properties,
you may use it to set them. If not, you may set them programatically as in
the following example. Note that you will need to replace the example values
below with the ones appropriate to your environment.
String licensekey = "1255087426532DDD35268256220ABTRRW";
System.setProperty("com.extentech.extenxls.licensekey", licensekey);
String jarloc = "/opt/ExtenXLS/lib/ExtenXLS.jar";
System.setProperty("com.extentech.extenxls.jarloc", jarloc);
WorkBook,
WorkSheetHandle,
CellHandle| Field Summary | |
|---|---|
static String |
CONVERTMULBLANKS
|
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). |
| Fields inherited from class com.extentech.ExtenXLS.DocumentHandle |
|---|
FORMAT_NATIVE |
| Fields inherited from interface com.extentech.ExtenXLS.WorkBook |
|---|
ALLOWDUPES, CALC_MODE_PROP, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, REFTRACK_PROP, SHAREDUPES, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE |
| Fields inherited from interface com.extentech.ExtenXLS.Document |
|---|
DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM |
| Constructor Summary | |
|---|---|
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. |
|
WorkBookHandle(com.extentech.toolkit.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,
com.extentech.toolkit.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 |
|
| Method Summary | |
|---|---|
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 |
boolean |
eventMode()
|
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 |
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. |
com.extentech.formats.XLS.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. |
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 |
File |
getImage(String fname,
int thumbWidth,
int thumbHeight,
int frameWidth,
int frameHeight)
Generate a thumbnail JPEG image of the first worksheet in the workbook Feb 8, 2011 |
ImageHandle[] |
getImages()
Returns all ImageHandles in the workbook |
boolean |
getIsExcel2007()
Returns whether the underlying spreadsheet is in Excel 2007 format by default. |
com.extentech.formats.LEO.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 |
String |
getStats()
Return useful statistics about this workbook. |
String |
getStats(boolean usehtml)
Return useful statistics about this workbook. |
com.extentech.formats.XLS.WorkBook |
getWorkBook()
Returns a low-level WorkBook. |
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. |
boolean |
is1904()
Returns whether this WorkBook is using the '1904' date system. |
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. |
static File |
saveComponentAsJPEG(Component comp,
Container cont,
String filename,
int[] szs)
Comment me, particularly comp and cont, what do these do? |
static File |
saveImageAsJPEG(BufferedImage bi,
String filename)
Utility method to save an image stream to a file location. |
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 Default col width Note: only affects undefined Columns containing Cells |
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. |
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 ExtenXLS |
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. |
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. |
| Methods inherited from class com.extentech.ExtenXLS.DocumentHandle |
|---|
addProperty, getFile, getFileName, getInstance, getProperties, getProperty, getVersion, setDebugLevel, setFile, setFileName, setName, setProperties, toString, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.extentech.ExtenXLS.WorkBook |
|---|
addProperty, getProperty, setDebugLevel, setName, toString |
| Field Detail |
|---|
public static String CONVERTMULBLANKS
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
| Constructor Detail |
|---|
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 read
public 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(com.extentech.toolkit.ProgressListener pn)
ProgressListener - object which is monitoring progress of WorkBook read
public WorkBookHandle(String fname,
com.extentech.toolkit.ProgressListener pn)
String - fname the name of the XLS file to readProgressListener - object which is monitoring progress of WorkBook read| Method Detail |
|---|
public boolean eventMode()
public com.extentech.formats.XLS.WorkBookFactory getFactory()
WARNING: This method is not part of the public API. Its use is not supported and behavior is subject to change.
public com.extentech.formats.LEO.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 boolean is1904()
public String getXLSVersionString()
public String getStats(boolean usehtml)
use - html line breaks
public String getStats()
public CellHandle getCell(String address)
throws com.extentech.formats.XLS.CellNotFoundException,
com.extentech.formats.XLS.WorkSheetNotFoundException
getCell in interface WorkBookaddress -
com.extentech.formats.XLS.CellNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundExceptionpublic CellRange[] getCellRanges()
public PivotTableHandle getPivotTable(String ptname)
throws com.extentech.formats.XLS.PivotTableNotFoundException
getPivotTable in interface WorkBookString - name of the PivotTable
com.extentech.formats.XLS.PivotTableNotFoundException
public PivotTableHandle[] getPivotTables()
throws com.extentech.formats.XLS.PivotTableNotFoundException
getPivotTables in interface WorkBookcom.extentech.formats.XLS.PivotTableNotFoundExceptionpublic 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 WorkBookint - Default Column width
public FormulaHandle getFormulaHandle(String celladdress)
throws com.extentech.formats.XLS.FormulaNotFoundException
com.extentech.formats.XLS.FormulaNotFoundExceptionpublic ImageHandle[] getImages()
public ImageHandle getImage(String imagename)
throws com.extentech.formats.XLS.ImageNotFoundException
imagename -
com.extentech.formats.XLS.ImageNotFoundException
public NameHandle getNamedRange(String rangename)
throws com.extentech.formats.XLS.CellNotFoundException
getNamedRange in interface WorkBookcom.extentech.formats.XLS.CellNotFoundException
public NameHandle getNamedRangeInScope(String rangename)
throws com.extentech.formats.XLS.CellNotFoundException
com.extentech.formats.XLS.CellNotFoundException
public 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 com.extentech.formats.XLS.ChartNotFoundException
getChart in interface WorkBookcom.extentech.formats.XLS.ChartNotFoundExceptionpublic ChartHandle[] getCharts()
getCharts in interface WorkBook
public ChartHandle getChartById(int id)
throws com.extentech.formats.XLS.ChartNotFoundException
id -
com.extentech.formats.XLS.ChartNotFoundExceptionpublic NameHandle[] getNamedRanges()
getNamedRanges in interface WorkBookpublic NameHandle[] getNamedRangesInScope()
public String getName()
getName in interface DocumentgetName in interface WorkBookgetName in class DocumentHandlepublic CellHandle[] getCells()
getCells in interface WorkBookpublic 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.
getBytes in interface WorkBook@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 String getFileExtension()
DocumentHandle
getFileExtension in class DocumentHandle
public 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 class DocumentHandledest - the stream to which the document should be writtenformat - the constant representing the desired output format
IllegalArgumentException - if the given type code is invalid
IOException - 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 format
IllegalArgumentException - if the given type code is invalid
IOException - if an error occurs while writing to the stream
Exception
@Deprecated
public void writeXLSXBytes(OutputStream dest)
throws Exception
#write(OutputStream,int) instead.
dest - the stream to which the document should be written
IOException - if an error occurs while writing to the stream
Exceptionpublic 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("com.extentech.ExtenXLS.autocreatelockdown","true");
writeBytes in interface WorkBookdest - the stream to which the document should be written
public void close()
close in interface Closeablepublic void reset()
DocumentHandle
reset in interface Documentreset in interface WorkBookreset in class DocumentHandlepublic WorkSheetHandle[] getWorkSheets()
getWorkSheets in interface WorkBook
public WorkSheetHandle getWorkSheet(int sheetnum)
throws com.extentech.formats.XLS.WorkSheetNotFoundException
getWorkSheet in interface WorkBookindex - of worksheet (ie: 0)
com.extentech.formats.XLS.WorkSheetNotFoundException - if the specified WorkSheet is
not found in the WorkBook.
public WorkSheetHandle getWorkSheet(String handstr)
throws com.extentech.formats.XLS.WorkSheetNotFoundException
getWorkSheet in interface WorkBookString - name of worksheet (ie: "Sheet1")
com.extentech.formats.XLS.WorkSheetNotFoundException - if the specified WorkSheet is
not found in the WorkBook.public com.extentech.formats.XLS.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 Mode
public void copyChartToSheet(String chartname,
String sheetname)
throws com.extentech.formats.XLS.ChartNotFoundException,
com.extentech.formats.XLS.WorkSheetNotFoundException
copyChartToSheet in interface WorkBookchartname - sheetname -
com.extentech.formats.XLS.ChartNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
public void copyChartToSheet(ChartHandle chart,
WorkSheetHandle sheet)
throws com.extentech.formats.XLS.ChartNotFoundException,
com.extentech.formats.XLS.WorkSheetNotFoundException
copyChartToSheet in interface WorkBookchart - sheet -
com.extentech.formats.XLS.ChartNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
public WorkSheetHandle copyWorkSheet(String SourceSheetName,
String NewSheetName)
throws com.extentech.formats.XLS.WorkSheetNotFoundException
copyWorkSheet in interface WorkBookString - the Name of the source worksheet;String - the Name of the new (destination) worksheet;
com.extentech.formats.XLS.WorkSheetNotFoundExceptionpublic void calculateFormulas()
calculateFormulas in interface WorkBookcom.extentech.formats.XLS.FunctionNotSupportedException - 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.
com.extentech.formats.XLS.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
public boolean addSheetFromWorkBook(WorkBookHandle sourceBook,
String sourceSheetName,
String destSheetName)
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 workbook
public boolean addSheetFromWorkBookWithFormatting(WorkBookHandle sourceBook,
String sourceSheetName,
String destSheetName)
sourceBook - - the WorkBook containing the sheet to copysourceSheetName - - the name of the sheet to copydestSheetName - - the name of the new sheet in this workbookpublic 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 ChartHandle createChart(String name,
WorkSheetHandle wsh)
String - the Name of the newly created Chart
public void deleteChart(String chartname,
WorkSheetHandle wsh)
throws com.extentech.formats.XLS.ChartNotFoundException
chartname -
com.extentech.formats.XLS.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 inserted
public WorkSheetHandle createWorkSheet(String name)
createWorkSheet in interface WorkBookname - the name of the newly created worksheet
public FormatHandle[] getFormats()
getFormats in interface WorkBookpublic FormatHandle[] getConditionalFormats()
public File getImage(String fname,
int thumbWidth,
int thumbHeight,
int frameWidth,
int frameHeight)
throws Exception
fname - thumbWidth - thumbHeight - frameWidth - frameHeight -
Exception
public static File saveComponentAsJPEG(Component comp,
Container cont,
String filename,
int[] szs)
public static File saveImageAsJPEG(BufferedImage bi,
String filename)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||