Package jxl
Class WorkbookSettings
java.lang.Object
jxl.WorkbookSettings
This is a bean which client applications may use to set various advanced
workbook properties. Use of this bean is not mandatory, and its absence
will merely result in workbooks being read/written using the default
settings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The HIDEOBJ record stores options selected in the Options dialog,View tab.static final int
The HIDEOBJ record stores options selected in the Options dialog,View tab.static final int
The HIDEOBJ record stores options selected in the Options dialog,View tab. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Accessor for the array grow size propertyboolean
Accessor for the autofilter disabled featureboolean
Accessor for the ignore cell validationint
Accessor for the character set.boolean
Gets the drawings disabled flagAccessor for the character encodingboolean
Has this file been written by excel 2000?Returns the two character ISO 3166 mnemonic used by excel for user language displayto displayReturns the two character ISO 3166 mnemonic used by excel for its regional settingsboolean
Accessor for the formula adjust disabledjxl.biff.formula.FunctionNames
Gets the function names.boolean
Accessor for the disabling of garbage collectionint
The HIDEOBJ record stores options selected in the Options dialog,View tab Possible values are: HIDEOBJ_HIDE_ALL, HIDEOBJ_SHOW_ALL and HIDEOBJ_SHOW_PLACEHOLDERSboolean
Accessor for the ignore blanks flagint
Accessor for the initial file size propertyReturns the locale used by JExcelAPI to read the spreadsheetboolean
Accessor to retrieve the merged cell checking flagboolean
Accessor for the disabling of interpretation of named rangesboolean
Accessor to retrieve the property sets disabled flagboolean
Accessor to retrieve the rationalization flagboolean
When true then Refresh All should be done on all external data ranges and PivotTables when loading the workbook (the default is =0)boolean
Workbook Is a TemplateUsed in conjunction with the UseTemporaryFileDuringWrite setting to set the target directory for the temporary files.boolean
Accessor for the temporary file during write.boolean
void
setArrayGrowSize
(int sz) Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data.void
setAutoFilterDisabled
(boolean disabled) Sets the autofilter disabledvoid
setCellValidationDisabled
(boolean cv) Sets the ignore cell validation flagvoid
setCharacterSet
(int cs) Sets the character set.void
setDrawingsDisabled
(boolean b) Disables the handling of drawingsvoid
setEncoding
(String enc) Sets the encoding for this workbookvoid
setExcel9File
(boolean excel9file) void
Sets the language in which the generated file will displayvoid
Sets the regional settings for the generated excel filevoid
setFormulaAdjust
(boolean b) Setter for the formula adjust disabled propertyvoid
setGCDisabled
(boolean disabled) Sets the garbage collection disabledvoid
setHideobj
(int hideobj) The HIDEOBJ record stores options selected in the Options dialog,View tab Possible values are: HIDEOBJ_HIDE_ALL, HIDEOBJ_SHOW_ALL and HIDEOBJ_SHOW_PLACEHOLDERSvoid
setIgnoreBlanks
(boolean ignoreBlanks) Sets the ignore blanks flagvoid
setInitialFileSize
(int sz) Sets the initial amount of memory allocated to store the workbook data when reading a worksheet.void
Sets the locale used by JExcelApi to generate the spreadsheet.void
setMergedCellChecking
(boolean b) Accessor to set the merged cell checkingvoid
setNamesDisabled
(boolean b) Disables the handling of namesvoid
setPropertySets
(boolean r) Sets whether or not to enable any property sets (such as macros) to be copied along with the workbook Leaving this feature enabled will result in the JXL process using more memoryvoid
setRationalization
(boolean r) Sets whether or not to rationalize the cell formats before writing out the sheet.void
setRefreshAll
(boolean refreshAll) When true then Refresh All should be done on all external data ranges and PivotTables when loading the workbook (the default is =0)void
setSuppressWarnings
(boolean w) Accessor to set the suppress warnings flag.void
setTemplate
(boolean template) Workbook Is a Templatevoid
Used in conjunction with the UseTemporaryFileDuringWrite setting to set the target directory for the temporary files.void
setUseTemporaryFileDuringWrite
(boolean temp) Sets whether a temporary file is used during the generation of the workbook.void
setWindowProtected
(boolean windowprotected) void
setWriteAccess
(String writeAccess)
-
Field Details
-
HIDEOBJ_HIDE_ALL
public static final int HIDEOBJ_HIDE_ALLThe HIDEOBJ record stores options selected in the Options dialog,View tab.- See Also:
-
HIDEOBJ_SHOW_PLACEHOLDERS
public static final int HIDEOBJ_SHOW_PLACEHOLDERSThe HIDEOBJ record stores options selected in the Options dialog,View tab.- See Also:
-
HIDEOBJ_SHOW_ALL
public static final int HIDEOBJ_SHOW_ALLThe HIDEOBJ record stores options selected in the Options dialog,View tab.- See Also:
-
-
Constructor Details
-
WorkbookSettings
public WorkbookSettings()Default constructor
-
-
Method Details
-
setArrayGrowSize
public void setArrayGrowSize(int sz) Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 1 megabyte- Parameters:
sz
- the file size in bytes
-
getArrayGrowSize
public int getArrayGrowSize()Accessor for the array grow size property- Returns:
- the array grow size
-
setInitialFileSize
public void setInitialFileSize(int sz) Sets the initial amount of memory allocated to store the workbook data when reading a worksheet. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 5 megabytes- Parameters:
sz
- the file size in bytes
-
getInitialFileSize
public int getInitialFileSize()Accessor for the initial file size property- Returns:
- the initial file size
-
getDrawingsDisabled
public boolean getDrawingsDisabled()Gets the drawings disabled flag- Returns:
- TRUE if drawings are disabled, FALSE otherwise
-
getGCDisabled
public boolean getGCDisabled()Accessor for the disabling of garbage collection- Returns:
- FALSE if JExcelApi hints for garbage collection, TRUE otherwise
-
getNamesDisabled
public boolean getNamesDisabled()Accessor for the disabling of interpretation of named ranges- Returns:
- FALSE if named cells are interpreted, TRUE otherwise
-
setNamesDisabled
public void setNamesDisabled(boolean b) Disables the handling of names- Parameters:
b
- TRUE to disable the names feature, FALSE otherwise
-
setDrawingsDisabled
public void setDrawingsDisabled(boolean b) Disables the handling of drawings- Parameters:
b
- TRUE to disable the names feature, FALSE otherwise
-
setRationalization
public void setRationalization(boolean r) Sets whether or not to rationalize the cell formats before writing out the sheet. The default value is true- Parameters:
r
- the rationalization flag
-
getRationalizationDisabled
public boolean getRationalizationDisabled()Accessor to retrieve the rationalization flag- Returns:
- TRUE if rationalization is off, FALSE if rationalization is on
-
getMergedCellCheckingDisabled
public boolean getMergedCellCheckingDisabled()Accessor to retrieve the merged cell checking flag- Returns:
- TRUE if merged cell checking is off, FALSE if it is on
-
setMergedCellChecking
public void setMergedCellChecking(boolean b) Accessor to set the merged cell checking- Parameters:
b
- - TRUE to enable merged cell checking, FALSE otherwise
-
setPropertySets
public void setPropertySets(boolean r) Sets whether or not to enable any property sets (such as macros) to be copied along with the workbook Leaving this feature enabled will result in the JXL process using more memory- Parameters:
r
- the property sets flag
-
getPropertySetsDisabled
public boolean getPropertySetsDisabled()Accessor to retrieve the property sets disabled flag- Returns:
- TRUE if property sets are disabled, FALSE otherwise
-
setSuppressWarnings
public void setSuppressWarnings(boolean w) Accessor to set the suppress warnings flag. Due to the change in logging in version 2.4, this will now set the warning behaviour across the JVM (depending on the type of logger used)- Parameters:
w
- the flag
-
getFormulaAdjust
public boolean getFormulaAdjust()Accessor for the formula adjust disabled- Returns:
- TRUE if formulas are adjusted following row/column inserts/deletes FALSE otherwise
-
setFormulaAdjust
public void setFormulaAdjust(boolean b) Setter for the formula adjust disabled property- Parameters:
b
- TRUE to adjust formulas, FALSE otherwise
-
setLocale
Sets the locale used by JExcelApi to generate the spreadsheet. Setting this value has no effect on the language or region of the generated excel file- Parameters:
l
- the locale
-
getLocale
Returns the locale used by JExcelAPI to read the spreadsheet- Returns:
- the locale
-
getEncoding
Accessor for the character encoding- Returns:
- the character encoding for this workbook
-
setEncoding
Sets the encoding for this workbook- Parameters:
enc
- the encoding
-
getFunctionNames
public jxl.biff.formula.FunctionNames getFunctionNames()Gets the function names. This is used by the formula parsing package in order to get the locale specific function names for this particular workbook- Returns:
- the list of function names
-
getCharacterSet
public int getCharacterSet()Accessor for the character set. This value is only used for reading and has no effect when writing out the spreadsheet- Returns:
- the character set used by this spreadsheet
-
setCharacterSet
public void setCharacterSet(int cs) Sets the character set. This is only used when the spreadsheet is read, and has no effect when the spreadsheet is written- Parameters:
cs
- the character set encoding value
-
setGCDisabled
public void setGCDisabled(boolean disabled) Sets the garbage collection disabled- Parameters:
disabled
- TRUE to disable garbage collection, FALSE to enable it
-
setIgnoreBlanks
public void setIgnoreBlanks(boolean ignoreBlanks) Sets the ignore blanks flag- Parameters:
ignoreBlanks
- TRUE to ignore blanks, FALSE to take them into account
-
getIgnoreBlanks
public boolean getIgnoreBlanks()Accessor for the ignore blanks flag- Returns:
- TRUE if blank cells are being ignored, FALSE otherwise
-
setCellValidationDisabled
public void setCellValidationDisabled(boolean cv) Sets the ignore cell validation flag- Parameters:
cv
- TRUE to disable cell validation, FALSE to enable it
-
getCellValidationDisabled
public boolean getCellValidationDisabled()Accessor for the ignore cell validation- Returns:
- TRUE if cell validation is disabled
-
getExcelDisplayLanguage
Returns the two character ISO 3166 mnemonic used by excel for user language displayto display- Returns:
- the display language
-
getExcelRegionalSettings
Returns the two character ISO 3166 mnemonic used by excel for its regional settings- Returns:
- the regional settings
-
setExcelDisplayLanguage
Sets the language in which the generated file will display- Parameters:
code
- the two character ISO 3166 country code
-
setExcelRegionalSettings
Sets the regional settings for the generated excel file- Parameters:
code
- the two character ISO 3166 country code
-
getAutoFilterDisabled
public boolean getAutoFilterDisabled()Accessor for the autofilter disabled feature- Returns:
- TRUE if autofilter is disabled, FALSE otherwise
-
setAutoFilterDisabled
public void setAutoFilterDisabled(boolean disabled) Sets the autofilter disabled- Parameters:
disabled
-
-
getUseTemporaryFileDuringWrite
public boolean getUseTemporaryFileDuringWrite()Accessor for the temporary file during write. If this is set, then when the workbook is written a temporary file will be used to store the interim binary data, otherwise it will take place in memory. Setting this flag involves an assessment of the trade-offs between memory usage and performance- Returns:
- TRUE if a temporary is file is used during writing, FALSE otherwise
-
setUseTemporaryFileDuringWrite
public void setUseTemporaryFileDuringWrite(boolean temp) Sets whether a temporary file is used during the generation of the workbook. If not set, the workbook will take place entirely in memory. Setting this flag involves an assessment of the trade-offs between memory usage and performance -
setTemporaryFileDuringWriteDirectory
Used in conjunction with the UseTemporaryFileDuringWrite setting to set the target directory for the temporary files. If this is not set, the system default temporary directory is used. This has no effect unless the useTemporaryFileDuringWrite setting is TRUE- Parameters:
dir
- the directory to which temporary files should be written
-
getTemporaryFileDuringWriteDirectory
Used in conjunction with the UseTemporaryFileDuringWrite setting to set the target directory for the temporary files. This value can be NULL, in which case the normal system default temporary directory is used instead- Returns:
- the temporary directory used during write, or NULL if it is not set
-
setRefreshAll
public void setRefreshAll(boolean refreshAll) When true then Refresh All should be done on all external data ranges and PivotTables when loading the workbook (the default is =0)- Parameters:
refreshAll
- the refreshAll to set
-
getRefreshAll
public boolean getRefreshAll()When true then Refresh All should be done on all external data ranges and PivotTables when loading the workbook (the default is =0)- Returns:
- the refreshAll value
-
getTemplate
public boolean getTemplate()Workbook Is a Template- Returns:
- the template
-
setTemplate
public void setTemplate(boolean template) Workbook Is a Template- Parameters:
template
- the template to set
-
getExcel9File
public boolean getExcel9File()Has this file been written by excel 2000?- Returns:
- the excel9file
-
setExcel9File
public void setExcel9File(boolean excel9file) - Parameters:
excel9file
- the excel9file to set
-
getWindowProtected
public boolean getWindowProtected()- Returns:
- the windowprotected
-
setWindowProtected
public void setWindowProtected(boolean windowprotected) - Parameters:
windowprotected
- the windowprotected to set
-
getHideobj
public int getHideobj()The HIDEOBJ record stores options selected in the Options dialog,View tab Possible values are: HIDEOBJ_HIDE_ALL, HIDEOBJ_SHOW_ALL and HIDEOBJ_SHOW_PLACEHOLDERS- Returns:
- the hideobj
-
setHideobj
public void setHideobj(int hideobj) The HIDEOBJ record stores options selected in the Options dialog,View tab Possible values are: HIDEOBJ_HIDE_ALL, HIDEOBJ_SHOW_ALL and HIDEOBJ_SHOW_PLACEHOLDERS- Parameters:
hideobj
- the hideobj to set
-
getWriteAccess
- Returns:
- the writeAccess
-
setWriteAccess
- Parameters:
writeAccess
- the writeAccess to set
-