com.extentech.ExtenXLS.web
Class MemeWorkBook

java.lang.Object
  extended by com.extentech.ExtenXLS.DocumentHandle
      extended by com.extentech.ExtenXLS.web.MemeDocument
          extended by com.extentech.ExtenXLS.web.MemeWorkBook
All Implemented Interfaces:
Document, Handle, WorkBook, com.extentech.toolkit.LogOutputter, Closeable
Direct Known Subclasses:
WebWorkBook

public class MemeWorkBook
extends MemeDocument
implements WorkBook, com.extentech.toolkit.LogOutputter

This class provides Saving and Reconstituting WorkBooks as memes in the Extentech KB schema.

Since:
Version:
Author:
John McMahon :: Copyright ©2011Extentech Inc.
See Also:

Field Summary
 
Fields inherited from class com.extentech.ExtenXLS.web.MemeDocument
ACCESS_STATUS_PRIVATE, ACCESS_STATUS_PUBLIC, ACCESS_STATUS_SHARED, FILE_TYPE_NATIVE, FILE_TYPE_XLS, FILE_TYPE_XLSX, FILE_TYPE_XMLSS, MEME_TYPE, STORAGE_LOCATION_DB, STORAGE_LOCATION_FILESYSTEM, STORAGE_LOCATION_S3
 
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
MemeWorkBook()
          May 16, 2010
MemeWorkBook(byte[] buf)
          May 25, 2010
MemeWorkBook(Connection dbc, byte[] in)
          May 16, 2010
MemeWorkBook(Connection dbcon, File fx)
          May 16, 2010
MemeWorkBook(Connection cx, int memeid, int storeType, int storeLocation)
          Deprecated. storetype and storelocation are now handled within storage
MemeWorkBook(int memeId, WorkBookHandle theBook)
          Create a new MemeWorkBook from the workbook passed in and set to the meme ID
MemeWorkBook(String finpath)
           
MemeWorkBook(String finpath, com.extentech.swingtools.ProgressDialog progdialog)
          May 25, 2010
MemeWorkBook(WorkBookHandle book)
           
 
Method Summary
 void addProperty(String name, Object val)
          Sets the value of a property in the workbook property store.
 boolean addSheetFromWorkBook(WorkBookHandle sourceBook, String sourceSheetName, String destSheetName)
          Deprecated.  
 boolean addSheetFromWorkBookWithFormatting(WorkBookHandle sourceBook, String sourceSheetName, String destSheetName)
          Deprecated.  
 WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet)
           
 WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet, 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 close()
           
 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)
           
 NameHandle createNamedRange(String name, String rangeDef)
           
 WorkSheetHandle createWorkSheet(String name)
          Creates a new worksheet and places it at the end of the workbook
 WorkSheetHandle createWorkSheet(String name, int sheetpos)
           
 void deleteChart(String chartname, WorkSheetHandle wsh)
           
 boolean equals(Object obj)
           
 boolean eventMode()
           
 String[] getAllStrings()
           
 String getAllStringsInDocument()
          Get all strings in the SST separated by crlf
 WorkBookHandle getBook()
          get the underlying WorkBookHandle delegate
 byte[] getBytes()
          Deprecated.  
 CellHandle getCell(String address)
          Returns the Cell at the specified Location
 CellRange[] getCellRanges()
           
 CellHandle[] getCells()
          Returns all of the Cells contained in the WorkBook
 ChartHandle getChart(String chartname)
          Returns a Chart Handle
 ChartHandle getChartById(int id)
           
 ChartHandle[] getCharts()
          Returns all Chart Handles contained in the WorkBook
 FormatHandle[] getConditionalFormats()
           
 com.extentech.formats.XLS.WorkBookFactory getFactory()
           
 String getFileExtension()
          Gets the file name extension for this document's native format.
 String getFileName()
          Gets the file associated with this document.
 int getFormat()
          Gets the constant representing this document's native format.
 FormatHandle[] getFormats()
          Returns an Array of all the FormatHandles present in the workbook
 int getFormulaCalculationMode()
           
 FormulaHandle getFormulaHandle(String celladdress)
           
 ImageHandle getImage(String imagename)
           
 File getImage(String fname, int thumbWidth, int thumbHeight, int frameWidth, int frameHeight)
           
 ImageHandle[] getImages()
           
 boolean getIsExcel2007()
           
 String getName()
          Gets the user-visible descriptive name or title of this document.
 NameHandle getNamedRange(String rangename)
          Returns a Named Range Handle
 NameHandle getNamedRangeInScope(String rangename)
           
 NameHandle[] getNamedRanges()
          Returns all Named Range Handles
 NameHandle[] getNamedRangesInScope()
           
 WorkBookHandle getNoSheetWorkBook()
          Returns a WorkBookHandle containing an empty version of this WorkBook.
 int getNumCells()
          Returns the number of Cells in this WorkBook
 int getNumWorkSheets()
           
 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
 Map getProperties()
          Retrieves a Map containing the workbook properties store.
 Object getProperty(String name)
          Retrieves a property in the workbook property store.
 String getStats()
           
 String getStats(boolean usehtml)
           
 WorkBookHandle getTarget()
          Returns the wrapped WorkBookHandle.
 com.extentech.formats.XLS.WorkBook getWorkBook()
          Returns a low-level WorkBook.
 WorkSheetHandle getWorkSheet(int sheetnum)
          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.
 String getXLSVersionString()
           
 String getXML()
          get the document as an XML String
 int hashCode()
           
 boolean is1904()
           
 void load(int memeid)
          Deprecated.  
 void markFormulasDirty()
           
 void recalc()
           
 void removeAllWorkSheets()
          Removes all of the WorkSheets from this WorkBook.
 void reset()
          Resets the document state to what it was when it was loaded.
 DocumentHandle revert()
          retrieve the latest from the db and replaces current workbook
 int searchAndReplace(String searchfor, String replacewith)
           
 void setDebugLevel(int l)
          Sets the debugging output 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 setFileName(String nm)
          Sets the file name associated with this document.
 void setFormulaCalculationMode(int CalcMode)
          Explicit calcing of formulas
 void setIsExcel2007(boolean isExcel2007)
           
 void setName(String nm)
          Sets the user-visible descriptive name or title of this document.
 void setProperties(Map properties)
          Replaces the workbook properties with the values in a given Map.
 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 ExtenXLS
 void setShowSheetTabs(boolean show)
           
 void setStringEncodingMode(int mode)
          Set Encoding mode of new Strings added to file.
 boolean showSheetTabs()
           
 String toString()
          Returns a string representation of the object.
 void write(File file)
          Writes the document to the given file in its native format.
 void write(File file, int format)
          Writes the document to the given file in the requested format.
 void write(OutputStream out)
          Writes the document to the given stream in its native format.
 void write(OutputStream out, boolean Excel2007Format)
           
 void write(OutputStream dest, int format)
          Writes the document to the given stream in the requested format.
 void write(String fname)
           
 void write(String fname, boolean Excel2007Format)
           
 StringBuffer writeBytes(OutputStream bout)
           
 void writeXLSXBytes(OutputStream bout)
           
 void writeXLSXBytes(OutputStream dest, int format)
           
 
Methods inherited from class com.extentech.ExtenXLS.web.MemeDocument
addUser, appendOutputDir, bindData, deleteDocument, documentStorageLocation, getAllDiffs, getBook, getConcurrentUsers, getConnection, getCryptPass, getDataFactory, getDatamapping, getDefaultFileString, getFile, getLatestDiff, getMemeId, getMemeResolved, getMemeType, getMessageManager, getOutputDir, getOwnerId, getRESTEmit, getRESTlog, getSaveAsFileType, getScript, getServerURL, getSession, getSharingAccess, getStorageLocation, getTempfile, getXMLStream, isPublic, isSaved, load, loadDataDefinition, loadDataDefinition, log, log, log, setConnection, setCryptPass, setDataFactory, setDatamapping, setFile, setMemeId, setMemeResolved, setMemeType, setMessageManager, setOutputDir, setOwnerId, setRESTlog, setSaveAsFileType, setSaved, setScript, setServerURL, setSession, setSharingAccess, setStorageLocation, setTempfile, setVal, storeDiff
 
Methods inherited from class com.extentech.ExtenXLS.DocumentHandle
getInstance, getVersion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.extentech.toolkit.LogOutputter
log, log, log
 

Constructor Detail

MemeWorkBook

public MemeWorkBook(Connection cx,
                    int memeid,
                    int storeType,
                    int storeLocation)
Deprecated. storetype and storelocation are now handled within storage

constructor with a meme_id

Parameters:
Connection - database connection
memeid - meme id
storeType - maps to STORAGE static ints, force to a specific save as type. native (0) will save as existing format

MemeWorkBook

public MemeWorkBook()
May 16, 2010


MemeWorkBook

public MemeWorkBook(int memeId,
                    WorkBookHandle theBook)
Create a new MemeWorkBook from the workbook passed in and set to the meme ID

Parameters:
theBook -

MemeWorkBook

public MemeWorkBook(WorkBookHandle book)

MemeWorkBook

public MemeWorkBook(Connection dbc,
                    byte[] in)
May 16, 2010

Parameters:
dbc -
in -

MemeWorkBook

public MemeWorkBook(Connection dbcon,
                    File fx)
May 16, 2010

Parameters:
dbcon -
fx -

MemeWorkBook

public MemeWorkBook(byte[] buf)
May 25, 2010

Parameters:
buf -

MemeWorkBook

public MemeWorkBook(String finpath,
                    com.extentech.swingtools.ProgressDialog progdialog)
May 25, 2010

Parameters:
finpath -
progdialog -

MemeWorkBook

public MemeWorkBook(String finpath)
Parameters:
file - pathname to input file
Method Detail

getTarget

public WorkBookHandle getTarget()
Returns the wrapped WorkBookHandle.


getBook

public WorkBookHandle getBook()
get the underlying WorkBookHandle delegate

Returns:
Returns the WorkBookHandle delegate

addProperty

public void addProperty(String name,
                        Object val)
Description copied from class: DocumentHandle
Sets the value of a property in the workbook property store. This is not an Excel-compatible feature.

Specified by:
addProperty in interface Document
Specified by:
addProperty in interface WorkBook
Overrides:
addProperty in class DocumentHandle
Parameters:
name -
val -
See Also:
DocumentHandle.addProperty(java.lang.String, java.lang.Object)

revert

public DocumentHandle revert()
retrieve the latest from the db and replaces current workbook

Specified by:
revert in class MemeDocument
Returns:
new WorkBook

addSheetFromWorkBook

public boolean addSheetFromWorkBook(WorkBookHandle sourceBook,
                                    String sourceSheetName,
                                    String destSheetName)
Deprecated. 

Description copied from interface: WorkBook
Inserts a worksheet from a Source WorkBook.

Specified by:
addSheetFromWorkBook in interface WorkBook
Parameters:
sourceBook -
sourceSheetName -
destSheetName -
Returns:
See Also:
WorkBookHandle.addSheetFromWorkBook(com.extentech.ExtenXLS.WorkBookHandle, java.lang.String, java.lang.String)

addSheetFromWorkBookWithFormatting

public boolean addSheetFromWorkBookWithFormatting(WorkBookHandle sourceBook,
                                                  String sourceSheetName,
                                                  String destSheetName)
Deprecated. 

Parameters:
sourceBook -
sourceSheetName -
destSheetName -
Returns:
See Also:
WorkBookHandle.addSheetFromWorkBookWithFormatting(com.extentech.ExtenXLS.WorkBookHandle, java.lang.String, java.lang.String)

addWorkSheet

public WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet,
                                    String NewSheetName)
Description copied from interface: WorkBook
Inserts a new worksheet and places it at the end of the workbook

Specified by:
addWorkSheet in interface WorkBook
Parameters:
sourceSheet -
NewSheetName -
Returns:
See Also:
WorkBookHandle.addWorkSheet(com.extentech.ExtenXLS.WorkSheetHandle, java.lang.String)

addWorkSheet

public WorkSheetHandle addWorkSheet(WorkSheetHandle sourceSheet)
Parameters:
sourceSheet -
Returns:
See Also:
WorkBookHandle.addWorkSheet(com.extentech.ExtenXLS.WorkSheetHandle)

getAllStringsInDocument

public String getAllStringsInDocument()
Get all strings in the SST separated by crlf

Specified by:
getAllStringsInDocument in class MemeDocument

close

public void close()
Specified by:
close in interface Closeable
See Also:
Closeable.close()

copyChartToSheet

public void copyChartToSheet(ChartHandle chart,
                             WorkSheetHandle sheet)
                      throws com.extentech.formats.XLS.ChartNotFoundException,
                             com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
Copies an existing Chart to another WorkSheet

Specified by:
copyChartToSheet in interface WorkBook
Parameters:
chart -
sheet -
Throws:
com.extentech.formats.XLS.ChartNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.copyChartToSheet(com.extentech.ExtenXLS.ChartHandle, com.extentech.ExtenXLS.WorkSheetHandle)

copyChartToSheet

public void copyChartToSheet(String chartname,
                             String sheetname)
                      throws com.extentech.formats.XLS.ChartNotFoundException,
                             com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
Copies an existing Chart to another WorkSheet

Specified by:
copyChartToSheet in interface WorkBook
Parameters:
chartname -
sheetname -
Throws:
com.extentech.formats.XLS.ChartNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.copyChartToSheet(java.lang.String, java.lang.String)

copyWorkSheet

public WorkSheetHandle copyWorkSheet(String SourceSheetName,
                                     String NewSheetName)
                              throws com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
Copy (duplicate) a worksheet in the workbook and add it to the end of the workbook with a new name

Specified by:
copyWorkSheet in interface WorkBook
Parameters:
SourceSheetName -
NewSheetName -
Returns:
Throws:
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.copyWorkSheet(java.lang.String, java.lang.String)

createChart

public ChartHandle createChart(String name,
                               WorkSheetHandle wsh)
Parameters:
name -
wsh -
Returns:
See Also:
WorkBookHandle.createChart(java.lang.String, com.extentech.ExtenXLS.WorkSheetHandle)

createNamedRange

public NameHandle createNamedRange(String name,
                                   String rangeDef)
Parameters:
name -
rangeDef -
Returns:
See Also:
WorkBookHandle.createNamedRange(java.lang.String, java.lang.String)

createWorkSheet

public WorkSheetHandle createWorkSheet(String name,
                                       int sheetpos)
Parameters:
name -
sheetpos -
Returns:
See Also:
WorkBookHandle.createWorkSheet(java.lang.String, int)

createWorkSheet

public WorkSheetHandle createWorkSheet(String name)
Description copied from interface: WorkBook
Creates a new worksheet and places it at the end of the workbook

Specified by:
createWorkSheet in interface WorkBook
Parameters:
name -
Returns:
See Also:
WorkBookHandle.createWorkSheet(java.lang.String)

deleteChart

public void deleteChart(String chartname,
                        WorkSheetHandle wsh)
                 throws com.extentech.formats.XLS.ChartNotFoundException
Parameters:
chartname -
wsh -
Throws:
com.extentech.formats.XLS.ChartNotFoundException
See Also:
WorkBookHandle.deleteChart(java.lang.String, com.extentech.ExtenXLS.WorkSheetHandle)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Parameters:
obj -
Returns:
See Also:
Object.equals(java.lang.Object)

getBytes

public byte[] getBytes()
Deprecated. 

Description copied from interface: WorkBook
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.

Specified by:
getBytes in interface WorkBook
Returns:
See Also:
WorkBookHandle.getBytes()

getCell

public CellHandle getCell(String address)
                   throws com.extentech.formats.XLS.CellNotFoundException,
                          com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
Returns the Cell at the specified Location

Specified by:
getCell in interface WorkBook
Parameters:
address -
Returns:
Throws:
com.extentech.formats.XLS.CellNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.getCell(java.lang.String)

getCellRanges

public CellRange[] getCellRanges()
Returns:
See Also:
WorkBookHandle.getCellRanges()

getCells

public CellHandle[] getCells()
Description copied from interface: WorkBook
Returns all of the Cells contained in the WorkBook

Specified by:
getCells in interface WorkBook
Returns:
See Also:
WorkBookHandle.getCells()

getChart

public ChartHandle getChart(String chartname)
                     throws com.extentech.formats.XLS.ChartNotFoundException
Description copied from interface: WorkBook
Returns a Chart Handle

Specified by:
getChart in interface WorkBook
Parameters:
chartname -
Returns:
Throws:
com.extentech.formats.XLS.ChartNotFoundException
See Also:
WorkBookHandle.getChart(java.lang.String)

getXML

public String getXML()
get the document as an XML String

Specified by:
getXML in class MemeDocument
Returns:

getChartById

public ChartHandle getChartById(int id)
                         throws com.extentech.formats.XLS.ChartNotFoundException
Parameters:
id -
Returns:
Throws:
com.extentech.formats.XLS.ChartNotFoundException
See Also:
WorkBookHandle.getChartById(int)

getCharts

public ChartHandle[] getCharts()
Description copied from interface: WorkBook
Returns all Chart Handles contained in the WorkBook

Specified by:
getCharts in interface WorkBook
Returns:
See Also:
WorkBookHandle.getCharts()

getConditionalFormats

public FormatHandle[] getConditionalFormats()
Returns:
See Also:
WorkBookHandle.getConditionalFormats()

getFormats

public FormatHandle[] getFormats()
Description copied from interface: WorkBook
Returns an Array of all the FormatHandles present in the workbook

Specified by:
getFormats in interface WorkBook
Returns:
See Also:
WorkBookHandle.getFormats()

getFormulaCalculationMode

public int getFormulaCalculationMode()
Specified by:
getFormulaCalculationMode in interface WorkBook
Returns:
See Also:
WorkBookHandle.getFormulaCalculationMode()

getFormulaHandle

public FormulaHandle getFormulaHandle(String celladdress)
                               throws com.extentech.formats.XLS.FormulaNotFoundException
Parameters:
celladdress -
Returns:
Throws:
com.extentech.formats.XLS.FormulaNotFoundException
See Also:
WorkBookHandle.getFormulaHandle(java.lang.String)

getImage

public ImageHandle getImage(String imagename)
                     throws com.extentech.formats.XLS.ImageNotFoundException
Parameters:
imagename -
Returns:
Throws:
com.extentech.formats.XLS.ImageNotFoundException
See Also:
WorkBookHandle.getImage(java.lang.String)

getImages

public ImageHandle[] getImages()
Returns:
See Also:
WorkBookHandle.getImages()

getIsExcel2007

public boolean getIsExcel2007()
Returns:
See Also:
WorkBookHandle.getIsExcel2007()

getName

public String getName()
Description copied from class: DocumentHandle
Gets the user-visible descriptive name or title of this document.

Specified by:
getName in interface Document
Specified by:
getName in interface WorkBook
Overrides:
getName in class DocumentHandle
Returns:
See Also:
WorkBookHandle.getName()

getNamedRange

public NameHandle getNamedRange(String rangename)
                         throws com.extentech.formats.XLS.CellNotFoundException
Description copied from interface: WorkBook
Returns a Named Range Handle

Specified by:
getNamedRange in interface WorkBook
Parameters:
rangename -
Returns:
Throws:
com.extentech.formats.XLS.CellNotFoundException
See Also:
WorkBookHandle.getNamedRange(java.lang.String)

getNamedRangeInScope

public NameHandle getNamedRangeInScope(String rangename)
                                throws com.extentech.formats.XLS.CellNotFoundException
Parameters:
rangename -
Returns:
Throws:
com.extentech.formats.XLS.CellNotFoundException
See Also:
WorkBookHandle.getNamedRangeInScope(java.lang.String)

getNamedRanges

public NameHandle[] getNamedRanges()
Description copied from interface: WorkBook
Returns all Named Range Handles

Specified by:
getNamedRanges in interface WorkBook
Returns:
See Also:
WorkBookHandle.getNamedRanges()

getNamedRangesInScope

public NameHandle[] getNamedRangesInScope()
Returns:
See Also:
WorkBookHandle.getNamedRangesInScope()

getNoSheetWorkBook

public WorkBookHandle getNoSheetWorkBook()
Description copied from interface: WorkBook
Returns a WorkBookHandle containing an empty version of this WorkBook. Use in conjunction with addSheetFromWorkBook() to create new output WorkBooks containing various sheets from a master template. ie: WorkBookHandle emptytemplate = this.getNoSheetWorkBook(); emptytemplate.addSheetFromWorkBook(this, "Sheet1", "TargetSheet");

Specified by:
getNoSheetWorkBook in interface WorkBook
Returns:
See Also:
WorkBookHandle.getNoSheetWorkBook()

getNumCells

public int getNumCells()
Description copied from interface: WorkBook
Returns the number of Cells in this WorkBook

Specified by:
getNumCells in interface WorkBook
Returns:
See Also:
WorkBookHandle.getNumCells()

getNumWorkSheets

public int getNumWorkSheets()
Returns:
See Also:
WorkBookHandle.getNumWorkSheets()

getPivotTable

public PivotTableHandle getPivotTable(String ptname)
                               throws com.extentech.formats.XLS.PivotTableNotFoundException
Description copied from interface: WorkBook
get a handle to a PivotTable in the WorkBook

Specified by:
getPivotTable in interface WorkBook
Parameters:
ptname -
Returns:
Throws:
com.extentech.formats.XLS.PivotTableNotFoundException
See Also:
WorkBookHandle.getPivotTable(java.lang.String)

getPivotTables

public PivotTableHandle[] getPivotTables()
                                  throws com.extentech.formats.XLS.PivotTableNotFoundException
Description copied from interface: WorkBook
get an array of handles to all PivotTables in the WorkBook

Specified by:
getPivotTables in interface WorkBook
Returns:
Throws:
com.extentech.formats.XLS.PivotTableNotFoundException
See Also:
WorkBookHandle.getPivotTables()

getProperties

public Map getProperties()
Description copied from class: DocumentHandle
Retrieves a Map containing the workbook properties store. This is not an Excel-compatible feature.

Overrides:
getProperties in class DocumentHandle
Returns:
See Also:
DocumentHandle.getProperties()

getProperty

public Object getProperty(String name)
Description copied from class: DocumentHandle
Retrieves a property in the workbook property store. This is not an Excel-compatible feature.

Specified by:
getProperty in interface Document
Specified by:
getProperty in interface WorkBook
Overrides:
getProperty in class DocumentHandle
Parameters:
name -
Returns:
See Also:
DocumentHandle.getProperty(java.lang.String)

getStats

public String getStats()
Returns:
See Also:
WorkBookHandle.getStats()

getStats

public String getStats(boolean usehtml)
Parameters:
usehtml -
Returns:
See Also:
WorkBookHandle.getStats(boolean)

getWorkBook

public com.extentech.formats.XLS.WorkBook getWorkBook()
Description copied from interface: WorkBook
Returns a low-level WorkBook. NOTE: The WorkBook class is NOT a part of the published API. Any of the methods and/or variables on a WorkBook object are subject to change without notice in new versions of ExtenXLS.

Specified by:
getWorkBook in interface WorkBook
Returns:
See Also:
WorkBookHandle.getWorkBook()

getWorkSheet

public WorkSheetHandle getWorkSheet(int sheetnum)
                             throws com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
returns the handle to a WorkSheet by name.

Specified by:
getWorkSheet in interface WorkBook
Parameters:
sheetnum -
Returns:
Throws:
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.getWorkSheet(int)

getWorkSheet

public WorkSheetHandle getWorkSheet(String handstr)
                             throws com.extentech.formats.XLS.WorkSheetNotFoundException
Description copied from interface: WorkBook
returns the handle to a WorkSheet by name.

Specified by:
getWorkSheet in interface WorkBook
Parameters:
handstr -
Returns:
Throws:
com.extentech.formats.XLS.WorkSheetNotFoundException
See Also:
WorkBookHandle.getWorkSheet(java.lang.String)

getWorkSheets

public WorkSheetHandle[] getWorkSheets()
Description copied from interface: WorkBook
Returns an array of handles to all of the WorkSheets in the Workbook.

Specified by:
getWorkSheets in interface WorkBook
Returns:
See Also:
WorkBookHandle.getWorkSheets()

getXLSVersionString

public String getXLSVersionString()
Returns:
See Also:
WorkBookHandle.getXLSVersionString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
See Also:
Object.hashCode()

is1904

public boolean is1904()
Returns:
See Also:
WorkBookHandle.is1904()

removeAllWorkSheets

public void removeAllWorkSheets()
Description copied from interface: WorkBook
Removes all of the WorkSheets from this WorkBook. Bytes streamed from this WorkBook will create invalid Spreadsheet files unless a WorkSheet(s) are added to it.

Specified by:
removeAllWorkSheets in interface WorkBook
See Also:
WorkBookHandle.removeAllWorkSheets()

reset

public void reset()
Description copied from class: DocumentHandle
Resets the document state to what it was when it was loaded.

Specified by:
reset in interface Document
Specified by:
reset in interface WorkBook
Specified by:
reset in class DocumentHandle
See Also:
DocumentHandle.reset()

searchAndReplace

public int searchAndReplace(String searchfor,
                            String replacewith)
Parameters:
searchfor -
replacewith -
Returns:
See Also:
WorkBookHandle.searchAndReplace(java.lang.String, java.lang.String)

setDebugLevel

public void setDebugLevel(int l)
Description copied from class: DocumentHandle
Sets the debugging output level. Higher values will produce more output. Output at higher values will generally only be of use to ExtenXLS developers. Increased output incurs a performance penalty, so it is recommended this be left at zero unless you are reporting a bug.

Specified by:
setDebugLevel in interface Document
Specified by:
setDebugLevel in interface WorkBook
Overrides:
setDebugLevel in class DocumentHandle
Parameters:
l -
See Also:
DocumentHandle.setDebugLevel(int)

setDefaultColWidth

public void setDefaultColWidth(int t)
Description copied from interface: WorkBook
set Default col width Note: only affects undefined Columns containing Cells

Specified by:
setDefaultColWidth in interface WorkBook
Parameters:
t -
See Also:
WorkBookHandle.setDefaultColWidth(int)

setDefaultRowHeight

public void setDefaultRowHeight(int t)
Description copied from interface: WorkBook
set Default row height Note: only affects undefined Rows containing Cells

Specified by:
setDefaultRowHeight in interface WorkBook
Parameters:
t -
See Also:
WorkBookHandle.setDefaultRowHeight(int)

setDupeStringMode

public void setDupeStringMode(int mode)
Description copied from interface: WorkBook
Set Duplicate String Handling 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, smaller file sizes, dupe Cells share changes WorkBookHandle.SHAREDUPES - slower inserts, changing Cells has no effect on dupe Cells

Specified by:
setDupeStringMode in interface WorkBook
Parameters:
mode -
See Also:
WorkBookHandle.setDupeStringMode(int)

setFormulaCalculationMode

public void setFormulaCalculationMode(int CalcMode)
Description copied from interface: WorkBook
Explicit calcing of formulas

Specified by:
setFormulaCalculationMode in interface WorkBook
Parameters:
CalcMode -
See Also:
WorkBookHandle.setFormulaCalculationMode(int)

setName

public void setName(String nm)
Description copied from class: DocumentHandle
Sets the user-visible descriptive name or title of this document. Some formats will persist this setting in the document itself.

Specified by:
setName in interface Document
Specified by:
setName in interface WorkBook
Overrides:
setName in class DocumentHandle
Parameters:
nm -
See Also:
DocumentHandle.setName(java.lang.String)

setProperties

public void setProperties(Map properties)
Description copied from class: DocumentHandle
Replaces the workbook properties with the values in a given Map. This is not an Excel-compatible feature.

Overrides:
setProperties in class DocumentHandle
Parameters:
properties -
See Also:
DocumentHandle.setProperties(java.util.Map)

setProtected

public void setProtected(boolean b)
Description copied from interface: WorkBook
set the workbook to protected mode Note: the password cannot be decrypted or changed in Excel -- protection can only be set/removed using ExtenXLS

Specified by:
setProtected in interface WorkBook
Parameters:
b -
See Also:
WorkBookHandle.setProtected(boolean)

setStringEncodingMode

public void setStringEncodingMode(int mode)
Description copied from interface: WorkBook
Set Encoding mode of new Strings added to file. ExtenXLS has 3 modes for handling the internal encoding of String data that is added to the file. ExtenXLS can save space in the file if it knows that all characters in your String data can be represented with a single byte (Compressed.) If your String contains characters which need 2 bytes to represent (such as Eastern-language characters) then it needs to be stored in an uncompressed Unicode format. ExtenXLS can either automatically detect the mode for each String, or you can set it explicitly. The auto mode is the most flexible but requires processing overhead. Default mode is WorkBookHandle.STRING_ENCODING_AUTO. Valid Modes Are: WorkBookHandle.STRING_ENCODING_AUTO Use if you are adding mixed Unicode and non-unicode Strings and can accept the performance hit -slowest String adds -optimal file size for mixed Strings WorkBookHandle.STRING_ENCODING_UNICODE Use if all of your new Strings are Unicode - faster than AUTO -faster than AUTO -largest file size WorkBookHandle.STRING_ENCODING_COMPRESSED Use if all of your new Strings are non-Unicode and can have high-bytes compressed -faster than AUTO -smallest file size

Specified by:
setStringEncodingMode in interface WorkBook
Parameters:
mode -
See Also:
WorkBookHandle.setStringEncodingMode(int)

toString

public String toString()
Description copied from class: DocumentHandle
Returns a string representation of the object. This is currently equivalent to DocumentHandle.getName().

Specified by:
toString in interface WorkBook
Overrides:
toString in class DocumentHandle
Returns:
See Also:
DocumentHandle.toString()

write

public void write(OutputStream out,
                  boolean Excel2007Format)
Parameters:
out -
Excel2007Format -
See Also:
WorkBookHandle.write(java.io.OutputStream, boolean)

write

public void write(OutputStream out)
           throws IOException
Description copied from class: DocumentHandle
Writes the document to the given stream in its native format.

Overrides:
write in class DocumentHandle
Parameters:
out -
Throws:
IOException - if an error occurs while writing to the stream
See Also:
DocumentHandle.write(java.io.OutputStream)

write

public void write(String fname,
                  boolean Excel2007Format)
Parameters:
fname -
Excel2007Format -
See Also:
WorkBookHandle.write(java.lang.String, boolean)

write

public void write(String fname)
Parameters:
fname -
See Also:
WorkBookHandle.write(java.lang.String)

writeBytes

public StringBuffer writeBytes(OutputStream bout)
Specified by:
writeBytes in interface WorkBook
Parameters:
bout -
Returns:
See Also:
WorkBookHandle.writeBytes(java.io.OutputStream)

writeXLSXBytes

public void writeXLSXBytes(OutputStream bout)
                    throws Exception
Parameters:
bout -
Throws:
Exception
See Also:
WorkBookHandle.writeXLSXBytes(java.io.OutputStream)

load

public void load(int memeid)
Deprecated. 

initialize the WorkBook from underlying data

Specified by:
load in class MemeDocument
Parameters:
memeid -

setFileName

public void setFileName(String nm)
Description copied from class: DocumentHandle
Sets the file name associated with this document.

Overrides:
setFileName in class DocumentHandle

getFileName

public String getFileName()
Gets the file associated with this document. For documents read in from a file, this defaults to that file. If no file is associated with this document, for example if the document was parsed from a stream, this may return null. public File getFile() { return myBook.getWorkBook().getFileName(); }

Overrides:
getFileName in class DocumentHandle

eventMode

public boolean eventMode()

getFactory

public com.extentech.formats.XLS.WorkBookFactory getFactory()

write

public void write(File file,
                  int format)
           throws IOException
Description copied from class: DocumentHandle
Writes the document to the given file in the requested format.

Overrides:
write in class DocumentHandle
Parameters:
file - the path to which the document should be written
format - the constant representing the desired output format
Throws:
IOException - if an error occurs while writing to the file

getAllStrings

public String[] getAllStrings()

write

public void write(File file)
           throws IOException
Description copied from class: DocumentHandle
Writes the document to the given file in its native format.

Overrides:
write in class DocumentHandle
Parameters:
file - the path to which the document should be written
Throws:
IOException - if an error occurs while writing to the stream

showSheetTabs

public boolean showSheetTabs()

setShowSheetTabs

public void setShowSheetTabs(boolean show)

getFormat

public int getFormat()
Description copied from class: DocumentHandle
Gets the constant representing this document's native format.

Specified by:
getFormat in class DocumentHandle

write

public void write(OutputStream dest,
                  int format)
           throws IOException
Description copied from class: DocumentHandle
Writes the document to the given stream in the requested format.

Specified by:
write in class DocumentHandle
Parameters:
dest - the stream to which the document should be written
format - the constant representing the desired output format
Throws:
IOException - if an error occurs while writing to the stream

writeXLSXBytes

public void writeXLSXBytes(OutputStream dest,
                           int format)
                    throws Exception
Throws:
Exception

setIsExcel2007

public void setIsExcel2007(boolean isExcel2007)

markFormulasDirty

public void markFormulasDirty()

recalc

public void recalc()

getImage

public File getImage(String fname,
                     int thumbWidth,
                     int thumbHeight,
                     int frameWidth,
                     int frameHeight)
              throws Exception
Throws:
Exception

getFileExtension

public String getFileExtension()
Description copied from class: DocumentHandle
Gets the file name extension for this document's native format.

Specified by:
getFileExtension in class DocumentHandle

calculateFormulas

public void calculateFormulas()
Description copied from interface: WorkBook
Iterate through the formulas in this WorkBook and call the calculate method on each. May be more expensive than calling update on individual FormulaHandles depending on extent of data changes to your WorkBook, or calling update on only the 'top-level' formula in a calculation. When a formula references a Cell containing another formula, it will recursively calculate until it reaches non-formula Cells. Thus, calling this method may calculate formula Cells in a heirarchy more than once.

Specified by:
calculateFormulas in interface WorkBook


Copyright © 2011 Extentech Inc. All Rights Reserved.