OoxmlSaveOptions

OoxmlSaveOptions class

Represents the options of saving office open xml file.

class OoxmlSaveOptions extends SaveOptions;

Constructors

NameDescription
constructor()Creates the options for saving office open xml file.
constructor(SaveOptions)Constructs from a parent object convertible to this.
constructor(SaveFormat)Creates the options for saving office open xml file.

Properties

PropertyTypeDescription
asFlatOpcbooleanIndicates whether saving as a flat opc file which can be generated by Open XML SDK.
exportCellNamebooleanIndicates if export cell name to Excel2007 .xlsx (.xlsm, .xltx, .xltm) file. If the output file may be accessed by SQL Server DTS, this value must be true. Setting the value to false will highly increase the performance and reduce the file size when creating large file. Default value is true.
lightCellsDataProviderLightCellsDataProviderThe data provider for saving workbook in light mode.
updateZoombooleanIndicates whether update scaling factor before saving the file if the PageSetup.FitToPagesWide and PageSetup.FitToPagesTall properties control how the worksheet is scaled.
enableZip64booleanAlways use ZIP64 extensions when writing zip archives, even when unnecessary.
embedOoxmlAsOleObjectbooleanIndicates whether embedding Ooxml files of OleObject as ole object.
compressionTypeOoxmlCompressionTypeGets and sets the compression type for ooxml file.
wpsCompatibilitybooleanIndicates whether to make the xls more compatible with WPS.
saveFormatSaveFormatReadonly. Gets the save file format.
clearDatabooleanMake the workbook empty after saving the file.
cachedFileFolderstringThe folder for temporary files that may be used as data cache.
validateMergedAreasbooleanIndicates whether validate merged cells before saving the file.
mergeAreasbooleanIndicates whether merge the areas of conditional formatting and validation before saving the file.
createDirectorybooleanIf true and the directory does not exist, the directory will be automatically created before saving the file.
sortNamesbooleanIndicates whether sorting defined names before saving file.
sortExternalNamesbooleanIndicates whether sorting external defined names before saving file.
refreshChartCachebooleanIndicates whether refreshing chart cache data
warningCallbackIWarningCallbackGets or sets warning callback.
checkExcelRestrictionbooleanWhether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K, it will be truncated.
updateSmartArtbooleanIndicates whether updating smart art setting. The default value is false.
encryptDocumentPropertiesbooleanIndicates whether encrypt document properties when saving as .xls file. The default value is true.

constructor()

Creates the options for saving office open xml file.

constructor();

constructor(SaveOptions)

Constructs from a parent object convertible to this.

constructor(obj: SaveOptions);

Parameters:

ParameterTypeDescription
objSaveOptionsThe parent object.

constructor(SaveFormat)

Creates the options for saving office open xml file.

constructor(saveFormat: SaveFormat);

Parameters:

ParameterTypeDescription
saveFormatSaveFormatThe file format. /// It should be one of following types: SaveFormat.Xlsx, SaveFormat.Xltx, /// SaveFormat.Xlam, SaveFormat.Xlsm or SaveFormat.Xltm, /// otherwise the saved format will be set as SaveFormat.Xlsx automatically.

asFlatOpc

Indicates whether saving as a flat opc file which can be generated by Open XML SDK.

asFlatOpc : boolean;

exportCellName

Indicates if export cell name to Excel2007 .xlsx (.xlsm, .xltx, .xltm) file. If the output file may be accessed by SQL Server DTS, this value must be true. Setting the value to false will highly increase the performance and reduce the file size when creating large file. Default value is true.

exportCellName : boolean;

lightCellsDataProvider

The data provider for saving workbook in light mode.

lightCellsDataProvider : LightCellsDataProvider;

updateZoom

Indicates whether update scaling factor before saving the file if the PageSetup.FitToPagesWide and PageSetup.FitToPagesTall properties control how the worksheet is scaled.

updateZoom : boolean;

Remarks

The default value is false for performance.

enableZip64

Always use ZIP64 extensions when writing zip archives, even when unnecessary.

enableZip64 : boolean;

embedOoxmlAsOleObject

Indicates whether embedding Ooxml files of OleObject as ole object.

embedOoxmlAsOleObject : boolean;

Remarks

Only for OleObject.

compressionType

Gets and sets the compression type for ooxml file.

compressionType : OoxmlCompressionType;

Remarks

The default value is OoxmlCompressionType.Level2.

wpsCompatibility

Indicates whether to make the xls more compatible with WPS.

wpsCompatibility : boolean;

saveFormat

Readonly. Gets the save file format.

saveFormat : SaveFormat;

clearData

Make the workbook empty after saving the file.

clearData : boolean;

cachedFileFolder

The folder for temporary files that may be used as data cache.

cachedFileFolder : string;

Remarks

If the folder has not been specified, the default value for it is CellsHelper.GetCacheFolder(). If its default value is null or empty, or has been specified as null or empty, then no cache file will be used when saving the workbook.

validateMergedAreas

Indicates whether validate merged cells before saving the file.

validateMergedAreas : boolean;

Remarks

The default value is false.

mergeAreas

Indicates whether merge the areas of conditional formatting and validation before saving the file.

mergeAreas : boolean;

Remarks

The default value is false.

createDirectory

If true and the directory does not exist, the directory will be automatically created before saving the file.

createDirectory : boolean;

Remarks

The default value is false.

sortNames

Indicates whether sorting defined names before saving file.

sortNames : boolean;

sortExternalNames

Indicates whether sorting external defined names before saving file.

sortExternalNames : boolean;

refreshChartCache

Indicates whether refreshing chart cache data

refreshChartCache : boolean;

warningCallback

Gets or sets warning callback.

warningCallback : IWarningCallback;

checkExcelRestriction

Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K, it will be truncated.

checkExcelRestriction : boolean;

updateSmartArt

Indicates whether updating smart art setting. The default value is false.

updateSmartArt : boolean;

Remarks

Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.

encryptDocumentProperties

Indicates whether encrypt document properties when saving as .xls file. The default value is true.

encryptDocumentProperties : boolean;

Remarks

Only for .xls,xlsx,xlsb and xlsm file.