com.extentech.ExtenXLS
Interface Document

All Known Subinterfaces:
WorkBook
All Known Implementing Classes:
com.extentech.ExtenDOC.DocHandle, EncryptedWorkBookHandle, FileWebWorkBook, MemeDoc, MemeDocument, MemeWorkBook, WebDoc, WebWorkBook, WorkBookHandle

public interface Document

An interface representing an ExtenXLS WorkBook.

Version:
4.1
Author:
John McMahon -- Copyright ©2010 Extentech Inc.
See Also:
WorkBookHandle

Field Summary
static int ALLOWDUPES
           
static int DEBUG_HIGH
           
static int DEBUG_LOW
           
static int DEBUG_MEDIUM
           
static int SHAREDUPES
           
static int STRING_ENCODING_AUTO
           
static int STRING_ENCODING_COMPRESSED
           
static int STRING_ENCODING_UNICODE
           
 
Method Summary
 void addProperty(String name, Object val)
          add non-Excel property
 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.
 ChartHandle getChart(String chartname)
          Returns a Chart Handle
 ChartHandle[] getCharts()
          Returns all Chart Handles contained in the WorkBook
 FormatHandle[] getFormats()
          Returns an Array of all the FormatHandles present in the workbook
 String getName()
          Returns the name of this WorkBook
 Object getProperty(String name)
          get a non-Excel property
 String getWorkingDirectory()
          Returns the directory containing the ExtenXLS.jar and extenxls.lic files.
 void reset()
          Clears all values in a template WorkBook.
 void setDebugLevel(int l)
          Set the Debugging level.
 void setDupeStringMode(int mode)
          Set Duplicate String Handling Mode.
 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 ExtenXLS
 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)
           
 

Field Detail

STRING_ENCODING_AUTO

static final int STRING_ENCODING_AUTO
See Also:
Constant Field Values

STRING_ENCODING_UNICODE

static final int STRING_ENCODING_UNICODE
See Also:
Constant Field Values

STRING_ENCODING_COMPRESSED

static final int STRING_ENCODING_COMPRESSED
See Also:
Constant Field Values

ALLOWDUPES

static final int ALLOWDUPES
See Also:
Constant Field Values

SHAREDUPES

static final int SHAREDUPES
See Also:
Constant Field Values

DEBUG_LOW

static final int DEBUG_LOW
See Also:
Constant Field Values

DEBUG_MEDIUM

static final int DEBUG_MEDIUM
See Also:
Constant Field Values

DEBUG_HIGH

static final int DEBUG_HIGH
See Also:
Constant Field Values
Method Detail

getProperty

Object getProperty(String name)
get a non-Excel property

Returns:
Returns the properties.

addProperty

void addProperty(String name,
                 Object val)
add non-Excel property

Parameters:
properties - The properties to set.

getFormats

FormatHandle[] getFormats()
Returns an Array of all the FormatHandles present in the workbook

Returns:
all existing FormatHandles in the workbook

setProtected

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

Parameters:
int - Default Column width

setName

void setName(String nm)
Sets the internal name of this WorkBookHandle. Overrides the default for 'getName()' which returns the file name source of this WorkBook by default.

Parameters:
WorkBook - Name

setDebugLevel

void setDebugLevel(int l)
Set the Debugging level. Higher values output more debugging info during execution.


getChart

ChartHandle getChart(String chartname)
                     throws com.extentech.formats.XLS.ChartNotFoundException
Returns a Chart Handle

Returns:
ChartHandle a Chart in the WorkBook
Throws:
com.extentech.formats.XLS.ChartNotFoundException

getCharts

ChartHandle[] getCharts()
Returns all Chart Handles contained in the WorkBook

Returns:
ChartHandle[] an array of all Charts in the WorkBook

getName

String getName()
Returns the name of this WorkBook

Returns:
String name of WorkBook

getBytes

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.

Returns:
byte[] the XLS File's bytes

getWorkingDirectory

String getWorkingDirectory()
Returns the directory containing the ExtenXLS.jar and extenxls.lic files. This must be called BEFORE using the byte Array WorkBookHandle constructor.

Returns:
String directory path containing ExtenXLS.jar and extenxls.lic

reset

void reset()
Clears all values in a template WorkBook. Use this method to 'reset' the values of your WorkBook in memory to defaults. For example, if you load a Servlet with a single WorkBookHandle instance, then modify values and stream to a Client system, yo should call 'clearAll()' when the request is completed to remove the modified values and set them back to a default.


setStringEncodingMode

void setStringEncodingMode(int mode)
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

Parameters:
int - String Encoding Mode

setDupeStringMode

void setDupeStringMode(int mode)
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

Parameters:
int - Duplicate String Handling Mode

toString

String toString()
Returns the name of this Sheet.

Overrides:
toString in class Object
See Also:
Object.toString()

writeBytes

StringBuffer writeBytes(OutputStream bbout)


Copyright © 2010 Extentech Inc. All Rights Reserved.