JsonSaveOptions
JsonSaveOptions class
Represents the options of saving the workbook as a json file.
class JsonSaveOptions extends SaveOptions;
Constructors
Name | Description |
---|---|
constructor() | Creates options for saving json file. |
constructor(SaveOptions) | Constructs from a parent object convertible to this. |
Properties
Property | Type | Description |
---|---|---|
exportStylePool | boolean | Indicates whether to export styles collectively or individually to each cell. |
exportHyperlinkType | JsonExportHyperlinkType | Represents the type of exporting hyperlink to json. |
skipEmptyRows | boolean | Indicates whether skipping emtpy rows. |
sheetIndexes | number[] | Represents the indexes of exported sheets. |
schemas | string[] | The original json schema of each worksheet. |
exportArea | CellArea | Gets or sets the exporting range. |
hasHeaderRow | boolean | Indicates whether the range contains header row. |
exportAsString | boolean | Exports the string value of the cells to json. |
indent | string | Indicates the indent. |
exportNestedStructure | boolean | Exported as parent-child hierarchy Json structure. |
exportEmptyCells | boolean | Indicates whether exporting empty cells as null. |
alwaysExportAsJsonObject | boolean | Indicates whether always exporting excel to json as object, even there is only a worksheet in the file. |
toExcelStruct | boolean | Indicates whether converting to json struct of the Excel file. |
saveFormat | SaveFormat | Readonly. Gets the save file format. |
clearData | boolean | Make the workbook empty after saving the file. |
cachedFileFolder | string | The folder for temporary files that may be used as data cache. |
validateMergedAreas | boolean | Indicates whether validate merged cells before saving the file. |
mergeAreas | boolean | Indicates whether merge the areas of conditional formatting and validation before saving the file. |
createDirectory | boolean | If true and the directory does not exist, the directory will be automatically created before saving the file. |
sortNames | boolean | Indicates whether sorting defined names before saving file. |
sortExternalNames | boolean | Indicates whether sorting external defined names before saving file. |
refreshChartCache | boolean | Indicates whether refreshing chart cache data |
warningCallback | IWarningCallback | Gets or sets warning callback. |
checkExcelRestriction | boolean | 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. |
updateSmartArt | boolean | Indicates whether updating smart art setting. The default value is false. |
encryptDocumentProperties | 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:
Parameter | Type | Description |
---|---|---|
obj | SaveOptions | The parent object. |
exportStylePool
Indicates whether to export styles collectively or individually to each cell.
exportStylePool : boolean;
exportHyperlinkType
Represents the type of exporting hyperlink to json.
exportHyperlinkType : JsonExportHyperlinkType;
Remarks
The default value is JsonExportHyperlinkType.DisplayString;
skipEmptyRows
Indicates whether skipping emtpy rows.
skipEmptyRows : boolean;
sheetIndexes
Represents the indexes of exported sheets.
sheetIndexes : number[];
schemas
The original json schema of each worksheet.
schemas : string[];
exportArea
Gets or sets the exporting range.
exportArea : CellArea;
hasHeaderRow
Indicates whether the range contains header row.
hasHeaderRow : boolean;
exportAsString
Exports the string value of the cells to json.
exportAsString : boolean;
indent
Indicates the indent.
indent : string;
Remarks
If the indent is null or empty, the exported json is not formatted.
exportNestedStructure
Exported as parent-child hierarchy Json structure.
exportNestedStructure : boolean;
exportEmptyCells
Indicates whether exporting empty cells as null.
exportEmptyCells : boolean;
alwaysExportAsJsonObject
Indicates whether always exporting excel to json as object, even there is only a worksheet in the file.
alwaysExportAsJsonObject : boolean;
toExcelStruct
Indicates whether converting to json struct of the Excel file.
toExcelStruct : boolean;
Remarks
Only for converting range to JSON.
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.