public class WorkbookSettings
extends java.lang.Object
Example
Workbook workbook = new Workbook();
WorkbookSettings settings = workbook.getSettings();
//do your business
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Releases resources.
|
java.lang.String |
getAuthor()
Gets the author of the file.
|
boolean |
getAutoCompressPictures()
Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
|
boolean |
getAutoRecover()
Indicates whether the file is marked for auto-recovery.
|
java.lang.String |
getBuildVersion()
Specifies the incremental public release of the application.
|
boolean |
getCheckCompatibility()
Indicates whether check compatibility with earlier versions when saving workbook.
|
boolean |
getCheckCustomNumberFormat()
Indicates whether checking custom number format when setting Style.Custom.
|
boolean |
getCheckExcelRestriction()
Whether check restriction of excel file when user modify cells related objects.
|
int |
getCompliance()
Specifies the OOXML version for the output document.
|
boolean |
getCrashSave()
indicates whether the application last saved the workbook file after a crash.
|
boolean |
getDataExtractLoad()
indicates whether the application last opened the workbook for data recovery.
|
boolean |
getDate1904()
Gets a value which represents if the workbook uses the 1904 date system.
|
int |
getDefaultImageResolution()
Gets default resolution of image.
|
DefaultStyleSettings |
getDefaultStyleSettings()
Gets the settings for default values of style-related properties for this workbook.
|
boolean |
getDiscardImageEditData()
Indicates whether discarding editting image data.
|
int |
getDisplayDrawingObjects()
Indicates whether and how to show objects in the workbook.
|
boolean |
getEnableMacros()
Enable macros;
|
int |
getFirstVisibleTab()
Gets the first visible worksheet tab.
|
FormulaSettings |
getFormulaSettings()
Gets the settings for formula-related features.
|
GlobalizationSettings |
getGlobalizationSettings()
Gets the globalization settings.
|
boolean |
getHidePivotFieldList()
Gets whether hide the field list for the PivotTable.
|
int |
getLanguageCode()
Gets the user interface language of the Workbook version based on CountryCode that has saved the file.
|
java.util.Locale |
getLocale()
Gets the Locale used by this workbook.
|
int |
getMaxColumn()
Gets the max column index, zero-based.
|
int |
getMaxRow()
Gets the max row index, zero-based.
|
int |
getMaxRowsOfSharedFormula()
Gets the max row number of shared formula.
|
int |
getMaxUniqueItemsPerField()
Gets the limitation of unique items per field
|
int |
getMemorySetting()
Gets the memory usage options.
|
char |
getNumberDecimalSeparator()
Gets the decimal separator for formatting/parsing numeric values.
|
char |
getNumberGroupSeparator()
Gets the character that separates groups of digits to the left of the decimal in numeric values.
|
int |
getPaperSize()
Gets the default print paper size.
|
java.lang.String |
getPassword()
Represents Workbook file encryption password.
|
boolean |
getPropertiesFollowChartPoint()
Indicates whether datapoint properties and datalabels in all charts in this workbook follow their reference.
|
int |
getProtectionType()
Gets the protection type of the workbook.
|
boolean |
getQuotePrefixToStyle()
Indicates whether setting
Style.getQuotePrefix() property when entering the string value(which starts with single quote mark ) to the cell |
int |
getRegion()
Gets the regional settings for workbook.
|
boolean |
getRemovePersonalInformation()
True if personal information can be removed from the specified workbook.
|
boolean |
getRepairLoad()
Indicates whether the application last opened the workbook in safe or repair mode.
|
IStreamProvider |
getResourceProvider()
Gets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
|
boolean |
getShared()
Gets a value that indicates whether the Workbook is shared.
|
int |
getSheetTabBarWidth()
Width of worksheet tab bar (in 1/1000 of window width).
|
boolean |
getShowTabs()
Gets a value whether the Workbook tabs are displayed.
|
int |
getSignificantDigits()
Deprecated.
Use SignificantDigitsType property instead.
|
int |
getSignificantDigitsType()
Gets the type of significant digits for outputing numeric
values in this workbook.
|
SmartTagOptions |
getSmartTagOptions()
Gets the options of the smart tag.
|
IStreamProvider |
getStreamProvider()
Deprecated.
Use ResourceProvider property instead.
|
java.lang.String |
getThemeFont(int type)
Gets the default theme font name.
|
boolean |
getUpdateAdjacentCellsBorder()
Indicates whether update adjacent cells' border.
|
int |
getUpdateLinksType()
Gets how updates external links when the workbook is opened.
|
IWarningCallback |
getWarningCallback()
Gets warning callback.
|
double |
getWindowHeight()
The height of the window, in unit of point.
|
double |
getWindowHeightCM()
The height of the window, in unit of centimeter.
|
double |
getWindowHeightInch()
The height of the window, in unit of inch.
|
double |
getWindowLeft()
The distance from the left edge of the client area to the left edge of the window, in unit of point.
|
double |
getWindowLeftCM()
The distance from the left edge of the client area to the left edge of the window.
|
double |
getWindowLeftInch()
The distance from the left edge of the client area to the left edge of the window.
|
double |
getWindowTop()
The distance from the top edge of the client area to the top edge of the window, in unit of point.
|
double |
getWindowTopCM()
The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
|
double |
getWindowTopInch()
The distance from the top edge of the client area to the top edge of the window, in unit of inch.
|
double |
getWindowWidth()
The width of the window, in unit of point.
|
double |
getWindowWidthCM()
The width of the window, in unit of centimeter.
|
double |
getWindowWidthInch()
The width of the window, in unit of inch.
|
WriteProtection |
getWriteProtection()
Provides access to the workbook write protection options.
|
boolean |
isDefaultEncrypted()
Indicates whether encrypting the workbook with default password if Structure and Windows of the workbook are locked.
|
boolean |
isEncrypted()
Gets a value that indicates whether a password is required to open this workbook.
|
boolean |
isHidden()
Indicates whether this workbook is hidden.
|
boolean |
isHScrollBarVisible()
Gets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar.
|
boolean |
isMinimized()
Represents whether the generated spreadsheet will be opened Minimized.
|
boolean |
isProtected()
Gets a value that indicates whether the structure or window of the Workbook is protected.
|
boolean |
isVScrollBarVisible()
Gets a value indicating whether the generated spreadsheet will contain a vertical scroll bar.
|
void |
setAuthor(java.lang.String value)
Sets the author of the file.
|
void |
setAutoCompressPictures(boolean value)
Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
|
void |
setAutoRecover(boolean value)
Indicates whether the file is marked for auto-recovery.
|
void |
setBuildVersion(java.lang.String value)
Specifies the incremental public release of the application.
|
void |
setCheckCompatibility(boolean value)
Indicates whether check compatibility with earlier versions when saving workbook.
|
void |
setCheckCustomNumberFormat(boolean value)
Indicates whether checking custom number format when setting Style.Custom.
|
void |
setCheckExcelRestriction(boolean value)
Whether check restriction of excel file when user modify cells related objects.
|
void |
setCompliance(int value)
Specifies the OOXML version for the output document.
|
void |
setCrashSave(boolean value)
indicates whether the application last saved the workbook file after a crash.
|
void |
setDataExtractLoad(boolean value)
indicates whether the application last opened the workbook for data recovery.
|
void |
setDate1904(boolean value)
Sets a value which represents if the workbook uses the 1904 date system.
|
void |
setDefaultEncrypted(boolean value)
Indicates whether encrypting the workbook with default password if Structure and Windows of the workbook are locked.
|
void |
setDefaultImageResolution(int value)
Sets default resolution of image.
|
void |
setDiscardImageEditData(boolean value)
Indicates whether discarding editting image data.
|
void |
setDisplayDrawingObjects(int value)
Indicates whether and how to show objects in the workbook.
|
void |
setEnableMacros(boolean value)
Enable macros;
|
void |
setFirstVisibleTab(int value)
Sets the first visible worksheet tab.
|
void |
setGlobalizationSettings(GlobalizationSettings value)
Sets the globalization settings.
|
void |
setHidden(boolean value)
Indicates whether this workbook is hidden.
|
void |
setHidePivotFieldList(boolean value)
Sets whether hide the field list for the PivotTable.
|
void |
setHScrollBarVisible(boolean value)
Sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar.
|
void |
setLanguageCode(int value)
Sets the user interface language of the Workbook version based on CountryCode that has saved the file.
|
void |
setLocale(java.util.Locale value)
Sets the Locale used by this workbook.
|
void |
setMaxRowsOfSharedFormula(int value)
Sets the max row number of shared formula.
|
void |
setMaxUniqueItemsPerField(int value)
Sets the limitation of unique items per field
|
void |
setMemorySetting(int value)
Sets the memory usage options.
|
void |
setMinimized(boolean value)
Represents whether the generated spreadsheet will be opened Minimized.
|
void |
setNumberDecimalSeparator(char value)
Sets the decimal separator for formatting/parsing numeric values.
|
void |
setNumberGroupSeparator(char value)
Sets the character that separates groups of digits to the left of the decimal in numeric values.
|
void |
setPageOrientationType(int pageOrientationType)
Set the type of print orientation for the whole workbook.
|
void |
setPaperSize(int value)
Sets the default print paper size.
|
void |
setPassword(java.lang.String value)
Represents Workbook file encryption password.
|
void |
setPropertiesFollowChartPoint(boolean value)
Indicates whether datapoint properties and datalabels in all charts in this workbook follow their reference.
|
void |
setQuotePrefixToStyle(boolean value)
Indicates whether setting
Style.getQuotePrefix() property when entering the string value(which starts with single quote mark ) to the cell |
void |
setRegion(int value)
Sets the regional settings for workbook.
|
void |
setRemovePersonalInformation(boolean value)
True if personal information can be removed from the specified workbook.
|
void |
setRepairLoad(boolean value)
Indicates whether the application last opened the workbook in safe or repair mode.
|
void |
setResourceProvider(IStreamProvider value)
Sets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
|
void |
setShared(boolean value)
Sets a value that indicates whether the Workbook is shared.
|
void |
setSheetTabBarWidth(int value)
Width of worksheet tab bar (in 1/1000 of window width).
|
void |
setShowTabs(boolean value)
Sets a value whether the Workbook tabs are displayed.
|
void |
setSignificantDigits(int value)
Deprecated.
Use SignificantDigitsType property instead.
|
void |
setSignificantDigitsType(int value)
Sets the type of significant digits for outputing numeric
values in this workbook.
|
void |
setStreamProvider(IStreamProvider value)
Deprecated.
Use ResourceProvider property instead.
|
void |
setUpdateAdjacentCellsBorder(boolean value)
Indicates whether update adjacent cells' border.
|
void |
setUpdateLinksType(int value)
Sets how updates external links when the workbook is opened.
|
void |
setVScrollBarVisible(boolean value)
Sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar.
|
void |
setWarningCallback(IWarningCallback value)
Sets warning callback.
|
void |
setWindowHeight(double value)
The height of the window, in unit of point.
|
void |
setWindowHeightCM(double value)
The height of the window, in unit of centimeter.
|
void |
setWindowHeightInch(double value)
The height of the window, in unit of inch.
|
void |
setWindowLeft(double value)
The distance from the left edge of the client area to the left edge of the window, in unit of point.
|
void |
setWindowLeftCM(double value)
The distance from the left edge of the client area to the left edge of the window.
|
void |
setWindowLeftInch(double value)
The distance from the left edge of the client area to the left edge of the window.
|
void |
setWindowTop(double value)
The distance from the top edge of the client area to the top edge of the window, in unit of point.
|
void |
setWindowTopCM(double value)
The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
|
void |
setWindowTopInch(double value)
The distance from the top edge of the client area to the top edge of the window, in unit of inch.
|
void |
setWindowWidth(double value)
The width of the window, in unit of point.
|
void |
setWindowWidthCM(double value)
The width of the window, in unit of centimeter.
|
void |
setWindowWidthInch(double value)
The width of the window, in unit of inch.
|
public void dispose()
public java.lang.String getThemeFont(int type)
type - FontSchemeType. The scheme type of the font.public IStreamProvider getStreamProvider()
Remarks
NOTE: This member is now obsolete. Instead, please use ResourceProvider property. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.public void setStreamProvider(IStreamProvider value)
Remarks
NOTE: This member is now obsolete. Instead, please use ResourceProvider property. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.public IStreamProvider getResourceProvider()
public void setResourceProvider(IStreamProvider value)
public java.lang.String getAuthor()
Remarks
It''s not set, checkBuiltInDocumentPropertyCollection.getAuthor() first, then check the user of Environment.public void setAuthor(java.lang.String value)
Remarks
It''s not set, checkBuiltInDocumentPropertyCollection.getAuthor() first, then check the user of Environment.public boolean getCheckCustomNumberFormat()
public void setCheckCustomNumberFormat(boolean value)
public boolean getEnableMacros()
Remarks
Now it only works when copying a worksheet to other worksheet in a workbook.public void setEnableMacros(boolean value)
Remarks
Now it only works when copying a worksheet to other worksheet in a workbook.public boolean getDate1904()
public void setDate1904(boolean value)
public int getProtectionType()
See ProtectionType.
public int getDisplayDrawingObjects()
public void setDisplayDrawingObjects(int value)
public int getSheetTabBarWidth()
public void setSheetTabBarWidth(int value)
public boolean getShowTabs()
Remarks
The default value is true.Example
The following code hides the Sheet Tabs and Tab Scrolling Buttons for the spreadsheet.
// Hide the spreadsheet tabs.
workbook.getSettings().setShowTabs(false);
public void setShowTabs(boolean value)
Remarks
The default value is true.public int getFirstVisibleTab()
public void setFirstVisibleTab(int value)
public boolean isHScrollBarVisible()
Remarks
The default value is true.Example
The following code makes the horizontal scroll bar invisible for the spreadsheet.
// Hide the horizontal scroll bar of the Excel file.
settings.setHScrollBarVisible(false);
public void setHScrollBarVisible(boolean value)
Remarks
The default value is true.public boolean isVScrollBarVisible()
Remarks
The default value is true.Example
The following code makes the vertical scroll bar invisible for the spreadsheet.
// Hide the vertical scroll bar of the Excel file.
settings.setVScrollBarVisible(false);
public void setVScrollBarVisible(boolean value)
Remarks
The default value is true.public boolean getShared()
Remarks
The default value is false.public void setShared(boolean value)
Remarks
The default value is false.public int getLanguageCode()
See CountryCode.
public void setLanguageCode(int value)
See CountryCode.
public int getRegion()
See CountryCode.
Remarks
1. Regional settings used by Aspose.Cells component for a workbook loaded from template file: i). For an XLS file, there are fields defined for regional settings and MS Excel does save regional settings data into the file when saving the XLS file. So, we use the saved region in the template file for the workbook. If you do not want to use the region saved in the XLS file, please reset it to the expected one (such as, CountryCode.Default) after loading the template file. And, we save the user specified value (by this method) into the file too when saving an XLS file. ii). For other file formats, such as, XLSX, XLSB...etc., there is no field defined for regional settings in the file format specification. So, we use the regional settings of application's environment for the workbook. And, the user specified value (by this method) cannot be kept for the generated files with those file formats. 2. For the view effect in MS Excel: The applied regional settings here can take effect only at runtime with Aspose.Cells component and not when viewing the generated file with MS Excel. Even for the generated XLS file in which the specified regional settings data has been saved, when viewing/editing it with MS Excel, the used region to perform formatting by MS Excel is always the default regional settings of the environment where MS Excel is running, not the one saved in the file. It is MS Excel's behavior and cannot be changed by code.public void setRegion(int value)
See CountryCode.
Remarks
1. Regional settings used by Aspose.Cells component for a workbook loaded from template file: i). For an XLS file, there are fields defined for regional settings and MS Excel does save regional settings data into the file when saving the XLS file. So, we use the saved region in the template file for the workbook. If you do not want to use the region saved in the XLS file, please reset it to the expected one (such as, CountryCode.Default) after loading the template file. And, we save the user specified value (by this method) into the file too when saving an XLS file. ii). For other file formats, such as, XLSX, XLSB...etc., there is no field defined for regional settings in the file format specification. So, we use the regional settings of application's environment for the workbook. And, the user specified value (by this method) cannot be kept for the generated files with those file formats. 2. For the view effect in MS Excel: The applied regional settings here can take effect only at runtime with Aspose.Cells component and not when viewing the generated file with MS Excel. Even for the generated XLS file in which the specified regional settings data has been saved, when viewing/editing it with MS Excel, the used region to perform formatting by MS Excel is always the default regional settings of the environment where MS Excel is running, not the one saved in the file. It is MS Excel's behavior and cannot be changed by code.public java.util.Locale getLocale()
Remarks
Returns null if neither Locale norgetRegion() is set.public void setLocale(java.util.Locale value)
Remarks
Returns null if neither Locale norgetRegion() is set.public GlobalizationSettings getGlobalizationSettings()
public void setGlobalizationSettings(GlobalizationSettings value)
public char getNumberDecimalSeparator()
public void setNumberDecimalSeparator(char value)
public char getNumberGroupSeparator()
public void setNumberGroupSeparator(char value)
public java.lang.String getPassword()
public void setPassword(java.lang.String value)
public WriteProtection getWriteProtection()
public boolean isEncrypted()
public boolean isProtected()
public boolean isDefaultEncrypted()
Remarks
The default value is false now. It's same as MS Excel 2013.public void setDefaultEncrypted(boolean value)
Remarks
The default value is false now. It's same as MS Excel 2013.public boolean isMinimized()
public void setMinimized(boolean value)
public boolean isHidden()
public void setHidden(boolean value)
public boolean getAutoCompressPictures()
public void setAutoCompressPictures(boolean value)
public boolean getRemovePersonalInformation()
Remarks
public void setRemovePersonalInformation(boolean value)
Remarks
public boolean getHidePivotFieldList()
public void setHidePivotFieldList(boolean value)
public int getMaxUniqueItemsPerField()
Remarks
public void setMaxUniqueItemsPerField(int value)
Remarks
public int getUpdateLinksType()
See UpdateLinksType.
public void setUpdateLinksType(int value)
See UpdateLinksType.
public void setPageOrientationType(int pageOrientationType)
pageOrientationType - PageOrientationType. The page orientation typepublic int getMaxRow()
Remarks
Returns 65535 if the file format is Excel97-2003;public int getMaxColumn()
Remarks
Returns 255 if the file format is Excel97-2003;public SmartTagOptions getSmartTagOptions()
public DefaultStyleSettings getDefaultStyleSettings()
public double getWindowLeft()
public void setWindowLeft(double value)
public double getWindowLeftInch()
public void setWindowLeftInch(double value)
public double getWindowLeftCM()
public void setWindowLeftCM(double value)
public double getWindowTop()
public void setWindowTop(double value)
public double getWindowTopInch()
public void setWindowTopInch(double value)
public double getWindowTopCM()
public void setWindowTopCM(double value)
public double getWindowWidth()
public void setWindowWidth(double value)
public double getWindowWidthInch()
public void setWindowWidthInch(double value)
public double getWindowWidthCM()
public void setWindowWidthCM(double value)
public double getWindowHeight()
public void setWindowHeight(double value)
public double getWindowHeightInch()
public void setWindowHeightInch(double value)
public double getWindowHeightCM()
public void setWindowHeightCM(double value)
public boolean getUpdateAdjacentCellsBorder()
Remarks
The default value is false. For example: the bottom border of the cell A1 is update, the top border of the cell A2 should be changed too.public void setUpdateAdjacentCellsBorder(boolean value)
Remarks
The default value is false. For example: the bottom border of the cell A1 is update, the top border of the cell A2 should be changed too.public int getSignificantDigits()
CellsHelper.getSignificantDigits().
Remarks
Only could be 15 or 17 now. NOTE: This member is now obsolete. Instead, please usegetSignificantDigitsType().
This property will be removed 12 months later since June 2025.
Aspose apologizes for any inconvenience you may have experienced.public void setSignificantDigits(int value)
CellsHelper.getSignificantDigits().
Remarks
Only could be 15 or 17 now. NOTE: This member is now obsolete. Instead, please usegetSignificantDigitsType().
This property will be removed 12 months later since June 2025.
Aspose apologizes for any inconvenience you may have experienced.public int getSignificantDigitsType()
CellsHelper.getSignificantDigitsType().
public void setSignificantDigitsType(int value)
CellsHelper.getSignificantDigitsType().
public boolean getCheckCompatibility()
Remarks
The default value is true. Only for Excel97-2003 xls or xlt files.public void setCheckCompatibility(boolean value)
Remarks
The default value is true. Only for Excel97-2003 xls or xlt files.public boolean getCheckExcelRestriction()
public void setCheckExcelRestriction(boolean value)
public boolean getAutoRecover()
public void setAutoRecover(boolean value)
public boolean getCrashSave()
public void setCrashSave(boolean value)
public boolean getDataExtractLoad()
public void setDataExtractLoad(boolean value)
public boolean getRepairLoad()
public void setRepairLoad(boolean value)
public java.lang.String getBuildVersion()
public void setBuildVersion(java.lang.String value)
public int getMemorySetting()
See MemorySetting.
Remarks
For more details about memory mode, please seeCells.getMemorySetting().public void setMemorySetting(int value)
See MemorySetting.
Remarks
For more details about memory mode, please seeCells.getMemorySetting().public int getPaperSize()
See PaperSizeType.
Remarks
If there is no setting about paper size,MS Excel will use default printer's setting.public void setPaperSize(int value)
See PaperSizeType.
Remarks
If there is no setting about paper size,MS Excel will use default printer's setting.public IWarningCallback getWarningCallback()
public void setWarningCallback(IWarningCallback value)
public int getMaxRowsOfSharedFormula()
Remarks
If the number is too large, the autofilter works very slow in MS Excel 2013.public void setMaxRowsOfSharedFormula(int value)
Remarks
If the number is too large, the autofilter works very slow in MS Excel 2013.public int getCompliance()
See OoxmlCompliance.
Remarks
Only for .xlsx files.public void setCompliance(int value)
See OoxmlCompliance.
Remarks
Only for .xlsx files.public boolean getQuotePrefixToStyle()
Style.getQuotePrefix() property when entering the string value(which starts with single quote mark ) to the cellpublic void setQuotePrefixToStyle(boolean value)
Style.getQuotePrefix() property when entering the string value(which starts with single quote mark ) to the cellpublic FormulaSettings getFormulaSettings()
public boolean getPropertiesFollowChartPoint()
public void setPropertiesFollowChartPoint(boolean value)
public boolean getDiscardImageEditData()
public void setDiscardImageEditData(boolean value)
public int getDefaultImageResolution()
public void setDefaultImageResolution(int value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.