SqlScriptSaveOptions

SqlScriptSaveOptions class

Represents the options of saving sql.

class SqlScriptSaveOptions extends SaveOptions;

Constructors

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

Methods

MethodDescription
getCheckIfTableExists()Check if the table name exists before creating
setCheckIfTableExists(boolean)Check if the table name exists before creating
getColumnTypeMap()Gets and sets the map of column type for different database.
setColumnTypeMap(SqlScriptColumnTypeMap)Gets and sets the map of column type for different database.
getCheckAllDataForColumnType()Check all data to find columns’ data type.
setCheckAllDataForColumnType(boolean)Check all data to find columns’ data type.
getAddBlankLineBetweenRows()Insert blank line between each data.
setAddBlankLineBetweenRows(boolean)Insert blank line between each data.
getSeparator()Gets and sets character separator of sql script.
setSeparator(string)Gets and sets character separator of sql script.
getOperatorType()Gets and sets the operator type of sql.
setOperatorType(SqlScriptOperatorType)Gets and sets the operator type of sql.
getPrimaryKey()Represents which column is primary key of the data table.
setPrimaryKey(number)Represents which column is primary key of the data table.
getCreateTable()Indicates whether exporting sql of creating table.
setCreateTable(boolean)Indicates whether exporting sql of creating table.
getIdName()Gets and sets the name of id column.
setIdName(string)Gets and sets the name of id column.
getStartId()Gets and sets the start id.
setStartId(number)Gets and sets the start id.
getTableName()Gets and sets the table name.
setTableName(string)Gets and sets the table name.
getExportAsString()Indicates whether exporting all data as string value.
setExportAsString(boolean)Indicates whether exporting all data as string value.
getSheetIndexes()Represents the indexes of exported sheets.
setSheetIndexes(number[])Represents the indexes of exported sheets.
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.
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.
getCheckExcelRestriction()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.
setCheckExcelRestriction(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.
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 sql file.

constructor();

constructor(SaveOptions)

Constructs from a parent object convertible to this.

constructor(obj: SaveOptions);

Parameters:

ParameterTypeDescription
objSaveOptionsThe parent object.

getCheckIfTableExists()

Check if the table name exists before creating

getCheckIfTableExists() : boolean;

setCheckIfTableExists(boolean)

Check if the table name exists before creating

setCheckIfTableExists(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getColumnTypeMap()

Gets and sets the map of column type for different database.

getColumnTypeMap() : SqlScriptColumnTypeMap;

Returns

SqlScriptColumnTypeMap

setColumnTypeMap(SqlScriptColumnTypeMap)

Gets and sets the map of column type for different database.

setColumnTypeMap(value: SqlScriptColumnTypeMap) : void;

Parameters:

ParameterTypeDescription
valueSqlScriptColumnTypeMapThe value to set.

getCheckAllDataForColumnType()

Check all data to find columns’ data type.

getCheckAllDataForColumnType() : boolean;

Remarks

The default value is false, we only check the first row for performance. If this property is true and the columns contains mixed value type, the columns’ type will be text.

setCheckAllDataForColumnType(boolean)

Check all data to find columns’ data type.

setCheckAllDataForColumnType(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false, we only check the first row for performance. If this property is true and the columns contains mixed value type, the columns’ type will be text.

getAddBlankLineBetweenRows()

Insert blank line between each data.

getAddBlankLineBetweenRows() : boolean;

Remarks

If Separator is ‘\n’ , it’s better to set this property as true to increase readability.

setAddBlankLineBetweenRows(boolean)

Insert blank line between each data.

setAddBlankLineBetweenRows(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

If Separator is ‘\n’ , it’s better to set this property as true to increase readability.

getSeparator()

Gets and sets character separator of sql script.

getSeparator() : string;

Remarks

Only can be ’ ’ or ‘\n’. If the

setSeparator(string)

Gets and sets character separator of sql script.

setSeparator(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

Remarks

Only can be ’ ’ or ‘\n’. If the

getOperatorType()

Gets and sets the operator type of sql.

getOperatorType() : SqlScriptOperatorType;

Returns

SqlScriptOperatorType

setOperatorType(SqlScriptOperatorType)

Gets and sets the operator type of sql.

setOperatorType(value: SqlScriptOperatorType) : void;

Parameters:

ParameterTypeDescription
valueSqlScriptOperatorTypeThe value to set.

getPrimaryKey()

Represents which column is primary key of the data table.

getPrimaryKey() : number;

setPrimaryKey(number)

Represents which column is primary key of the data table.

setPrimaryKey(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getCreateTable()

Indicates whether exporting sql of creating table.

getCreateTable() : boolean;

setCreateTable(boolean)

Indicates whether exporting sql of creating table.

setCreateTable(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getIdName()

Gets and sets the name of id column.

getIdName() : string;

Remarks

If this property is set , a column will be inserted with automatical increment int value.

setIdName(string)

Gets and sets the name of id column.

setIdName(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

Remarks

If this property is set , a column will be inserted with automatical increment int value.

getStartId()

Gets and sets the start id.

getStartId() : number;

Remarks

Only works when IdName is set.

setStartId(number)

Gets and sets the start id.

setStartId(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

Remarks

Only works when IdName is set.

getTableName()

Gets and sets the table name.

getTableName() : string;

setTableName(string)

Gets and sets the table name.

setTableName(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getExportAsString()

Indicates whether exporting all data as string value.

getExportAsString() : boolean;

setExportAsString(boolean)

Indicates whether exporting all data as string value.

setExportAsString(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.

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.

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

getCheckExcelRestriction()

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.

getCheckExcelRestriction() : boolean;

setCheckExcelRestriction(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.

setCheckExcelRestriction(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

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.