JsonSaveOptions

JsonSaveOptions class

Represents the options of saving the workbook as a json file.

class JsonSaveOptions extends SaveOptions;

Constructors

NameDescription
constructor()Creates options for saving json file.
constructor(SaveOptions)Constructs from a parent object convertible to this.

Methods

MethodDescription
getExportHyperlinkType()Represents the type of exporting hyperlink to json.
setExportHyperlinkType(JsonExportHyperlinkType)Represents the type of exporting hyperlink to json.
getSkipEmptyRows()Indicates whether skipping emtpy rows.
setSkipEmptyRows(boolean)Indicates whether skipping emtpy rows.
getSheetIndexes()Represents the indexes of exported sheets.
setSheetIndexes(number[])Represents the indexes of exported sheets.
getSchemas()The original json schema of each worksheet.
setSchemas(string[])The original json schema of each worksheet.
getExportArea()Gets or sets the exporting range.
setExportArea(CellArea)Gets or sets the exporting range.
getHasHeaderRow()Indicates whether the range contains header row.
setHasHeaderRow(boolean)Indicates whether the range contains header row.
getExportAsString()Exports the string value of the cells to json.
setExportAsString(boolean)Exports the string value of the cells to json.
getIndent()Indicates the indent.
setIndent(string)Indicates the indent.
getExportNestedStructure()Exported as parent-child hierarchy Json structure.
setExportNestedStructure(boolean)Exported as parent-child hierarchy Json structure.
getExportEmptyCells()Indicates whether exporting empty cells as null.
setExportEmptyCells(boolean)Indicates whether exporting empty cells as null.
getAlwaysExportAsJsonObject()Indicates whether always exporting excel to json as object, even there is only a worksheet in the file.
setAlwaysExportAsJsonObject(boolean)Indicates whether always exporting excel to json as object, even there is only a worksheet in the file.
getToExcelStruct()Indicates whether converting to json struct of the Excel file.
setToExcelStruct(boolean)Indicates whether converting to json struct of the Excel file.
isNull()Checks whether the implementation object is null.
getSaveFormat()Gets the save file format.
getClearData()Make the workbook empty after saving the file.
setClearData(boolean)Make the workbook empty after saving the file.
getCachedFileFolder()The cached file folder is used to store some large data.
setCachedFileFolder(string)The cached file folder is used to store some large data.
getValidateMergedAreas()Indicates whether validate merged cells before saving the file.
setValidateMergedAreas(boolean)Indicates whether validate merged cells before saving the file.
getMergeAreas()Indicates whether merge the areas of conditional formatting and validation before saving the file.
setMergeAreas(boolean)Indicates whether merge the areas of conditional formatting and validation before saving the file.
getCreateDirectory()If true and the directory does not exist, the directory will be automatically created before saving the file.
setCreateDirectory(boolean)If true and the directory does not exist, the directory will be automatically created before saving the file.
getSortNames()Indicates whether sorting defined names before saving file.
setSortNames(boolean)Indicates whether sorting defined names before saving file.
getSortExternalNames()Indicates whether sorting external defined names before saving file.
setSortExternalNames(boolean)Indicates whether sorting external defined names before saving file.
getRefreshChartCache()Indicates whether refreshing chart cache data
setRefreshChartCache(boolean)Indicates whether refreshing chart cache data
setWarningCallback(IWarningCallback)Gets or sets warning callback.
getWarningCallback()Gets or sets warning callback.
getUpdateSmartArt()Indicates whether updating smart art setting. The default value is false.
setUpdateSmartArt(boolean)Indicates whether updating smart art setting. The default value is false.
getEncryptDocumentProperties()Indicates whether encrypt document properties when saving as .xls file. The default value is true.
setEncryptDocumentProperties(boolean)Indicates whether encrypt document properties when saving as .xls file. The default value is true.

constructor()

Creates options for saving json file.

constructor();

constructor(SaveOptions)

Constructs from a parent object convertible to this.

constructor(obj: SaveOptions);

Parameters:

ParameterTypeDescription
objSaveOptionsThe parent object.

getExportHyperlinkType()

Represents the type of exporting hyperlink to json.

getExportHyperlinkType() : JsonExportHyperlinkType;

Returns

JsonExportHyperlinkType

Remarks

The default value is JsonExportHyperlinkType.DisplayString;

setExportHyperlinkType(JsonExportHyperlinkType)

Represents the type of exporting hyperlink to json.

setExportHyperlinkType(value: JsonExportHyperlinkType) : void;

Parameters:

ParameterTypeDescription
valueJsonExportHyperlinkTypeThe value to set.

Remarks

The default value is JsonExportHyperlinkType.DisplayString;

getSkipEmptyRows()

Indicates whether skipping emtpy rows.

getSkipEmptyRows() : boolean;

setSkipEmptyRows(boolean)

Indicates whether skipping emtpy rows.

setSkipEmptyRows(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getSheetIndexes()

Represents the indexes of exported sheets.

getSheetIndexes() : number[];

Returns

number[]

setSheetIndexes(number[])

Represents the indexes of exported sheets.

setSheetIndexes(value: number[]) : void;

Parameters:

ParameterTypeDescription
valuenumber[]The value to set.

getSchemas()

The original json schema of each worksheet.

getSchemas() : string[];

Returns

string[]

setSchemas(string[])

The original json schema of each worksheet.

setSchemas(value: string[]) : void;

Parameters:

ParameterTypeDescription
valuestring[]The value to set.

getExportArea()

Gets or sets the exporting range.

getExportArea() : CellArea;

Returns

CellArea

setExportArea(CellArea)

Gets or sets the exporting range.

setExportArea(value: CellArea) : void;

Parameters:

ParameterTypeDescription
valueCellAreaThe value to set.

getHasHeaderRow()

Indicates whether the range contains header row.

getHasHeaderRow() : boolean;

setHasHeaderRow(boolean)

Indicates whether the range contains header row.

setHasHeaderRow(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getExportAsString()

Exports the string value of the cells to json.

getExportAsString() : boolean;

setExportAsString(boolean)

Exports the string value of the cells to json.

setExportAsString(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getIndent()

Indicates the indent.

getIndent() : string;

Remarks

If the indent is null or empty, the exported json is not formatted.

setIndent(string)

Indicates the indent.

setIndent(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

Remarks

If the indent is null or empty, the exported json is not formatted.

getExportNestedStructure()

Exported as parent-child hierarchy Json structure.

getExportNestedStructure() : boolean;

setExportNestedStructure(boolean)

Exported as parent-child hierarchy Json structure.

setExportNestedStructure(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getExportEmptyCells()

Indicates whether exporting empty cells as null.

getExportEmptyCells() : boolean;

setExportEmptyCells(boolean)

Indicates whether exporting empty cells as null.

setExportEmptyCells(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getAlwaysExportAsJsonObject()

Indicates whether always exporting excel to json as object, even there is only a worksheet in the file.

getAlwaysExportAsJsonObject() : boolean;

setAlwaysExportAsJsonObject(boolean)

Indicates whether always exporting excel to json as object, even there is only a worksheet in the file.

setAlwaysExportAsJsonObject(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getToExcelStruct()

Indicates whether converting to json struct of the Excel file.

getToExcelStruct() : boolean;

Remarks

Only for converting range to JSON.

setToExcelStruct(boolean)

Indicates whether converting to json struct of the Excel file.

setToExcelStruct(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Only for converting range to JSON.

isNull()

Checks whether the implementation object is null.

isNull() : boolean;

getSaveFormat()

Gets the save file format.

getSaveFormat() : SaveFormat;

Returns

SaveFormat

getClearData()

Make the workbook empty after saving the file.

getClearData() : boolean;

setClearData(boolean)

Make the workbook empty after saving the file.

setClearData(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getCachedFileFolder()

The cached file folder is used to store some large data.

getCachedFileFolder() : string;

setCachedFileFolder(string)

The cached file folder is used to store some large data.

setCachedFileFolder(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getValidateMergedAreas()

Indicates whether validate merged cells before saving the file.

getValidateMergedAreas() : boolean;

Remarks

The default value is false.

setValidateMergedAreas(boolean)

Indicates whether validate merged cells before saving the file.

setValidateMergedAreas(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getMergeAreas()

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

getMergeAreas() : boolean;

Remarks

The default value is false.

setMergeAreas(boolean)

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

setMergeAreas(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getCreateDirectory()

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

getCreateDirectory() : boolean;

Remarks

The default value is false.

setCreateDirectory(boolean)

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

setCreateDirectory(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getSortNames()

Indicates whether sorting defined names before saving file.

getSortNames() : boolean;

setSortNames(boolean)

Indicates whether sorting defined names before saving file.

setSortNames(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getSortExternalNames()

Indicates whether sorting external defined names before saving file.

getSortExternalNames() : boolean;

setSortExternalNames(boolean)

Indicates whether sorting external defined names before saving file.

setSortExternalNames(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getRefreshChartCache()

Indicates whether refreshing chart cache data

getRefreshChartCache() : boolean;

setRefreshChartCache(boolean)

Indicates whether refreshing chart cache data

setRefreshChartCache(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

setWarningCallback(IWarningCallback)

Gets or sets warning callback.

setWarningCallback(value: IWarningCallback) : void;

Parameters:

ParameterTypeDescription
valueIWarningCallbackThe value to set.

getWarningCallback()

Gets or sets warning callback.

getWarningCallback() : IWarningCallback;

Returns

IWarningCallback

getUpdateSmartArt()

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

getUpdateSmartArt() : boolean;

Remarks

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

setUpdateSmartArt(boolean)

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

setUpdateSmartArt(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

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

getEncryptDocumentProperties()

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

getEncryptDocumentProperties() : boolean;

Remarks

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

setEncryptDocumentProperties(boolean)

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

setEncryptDocumentProperties(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

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