TxtSaveOptions

TxtSaveOptions class

Represents the save options for csv/tab delimited/other text format.

class TxtSaveOptions extends SaveOptions;

Constructors

NameDescription
constructor()Creates text file save options.
constructor(SaveOptions)Constructs from a parent object convertible to this.
constructor(SaveFormat)Creates text file save options.

Methods

MethodDescription
getSeparator()Gets and sets char Delimiter of text file.
setSeparator(string)Gets and sets char Delimiter of text file.
getSeparatorString()Gets and sets a string value as separator.
setSeparatorString(string)Gets and sets a string value as separator.
getEncoding()Gets and sets the default encoding.
setEncoding(EncodingType)Gets and sets the default encoding.
getQuoteType()Gets or sets how to quote values in the exported text file.
setQuoteType(TxtValueQuoteType)Gets or sets how to quote values in the exported text file.
getFormatStrategy()Gets and sets the format strategy when exporting the cell value as string.
setFormatStrategy(CellValueFormatStrategy)Gets and sets the format strategy when exporting the cell value as string.
getLightCellsDataProvider()The data provider for saving workbook in light mode.
setLightCellsDataProvider(LightCellsDataProvider)The data provider for saving workbook in light mode.
getTrimLeadingBlankRowAndColumn()Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true.
setTrimLeadingBlankRowAndColumn(boolean)Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true.
getTrimTailingBlankCells()Indicates whether tailing blank cells in one row should be trimmed. Default is false.
setTrimTailingBlankCells(boolean)Indicates whether tailing blank cells in one row should be trimmed. Default is false.
getKeepSeparatorsForBlankRow()Indicates whether separators should be output for blank row. Default value is false so by default the content for blank row will be empty.
setKeepSeparatorsForBlankRow(boolean)Indicates whether separators should be output for blank row. Default value is false so by default the content for blank row will be empty.
getExportArea()The range of cells to be exported.
setExportArea(CellArea)The range of cells to be exported.
getExportQuotePrefix()Indicates whether the single quote sign should be exported as part of the value of one cell when Style.QuotePrefix is true for it. Default is false.
setExportQuotePrefix(boolean)Indicates whether the single quote sign should be exported as part of the value of one cell when Style.QuotePrefix is true for it. Default is false.
getExportAllSheets()Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel.
setExportAllSheets(boolean)Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel.
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.

constructor()

Creates text file save options.

constructor();

constructor(SaveOptions)

Constructs from a parent object convertible to this.

constructor(obj: SaveOptions);

Parameters:

ParameterTypeDescription
objSaveOptionsThe parent object.

constructor(SaveFormat)

Creates text file save options.

constructor(saveFormat: SaveFormat);

Parameters:

ParameterTypeDescription
saveFormatSaveFormatThe file format. /// It should be SaveFormat.Csv or SaveFormat.Csv, /// otherwise the saved format will be set as SaveFormat.Csv automatically.

getSeparator()

Gets and sets char Delimiter of text file.

getSeparator() : string;

setSeparator(string)

Gets and sets char Delimiter of text file.

setSeparator(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getSeparatorString()

Gets and sets a string value as separator.

getSeparatorString() : string;

setSeparatorString(string)

Gets and sets a string value as separator.

setSeparatorString(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getEncoding()

Gets and sets the default encoding.

getEncoding() : EncodingType;

Returns

EncodingType

setEncoding(EncodingType)

Gets and sets the default encoding.

setEncoding(value: EncodingType) : void;

Parameters:

ParameterTypeDescription
valueEncodingTypeThe value to set.

getQuoteType()

Gets or sets how to quote values in the exported text file.

getQuoteType() : TxtValueQuoteType;

Returns

TxtValueQuoteType

setQuoteType(TxtValueQuoteType)

Gets or sets how to quote values in the exported text file.

setQuoteType(value: TxtValueQuoteType) : void;

Parameters:

ParameterTypeDescription
valueTxtValueQuoteTypeThe value to set.

getFormatStrategy()

Gets and sets the format strategy when exporting the cell value as string.

getFormatStrategy() : CellValueFormatStrategy;

Returns

CellValueFormatStrategy

setFormatStrategy(CellValueFormatStrategy)

Gets and sets the format strategy when exporting the cell value as string.

setFormatStrategy(value: CellValueFormatStrategy) : void;

Parameters:

ParameterTypeDescription
valueCellValueFormatStrategyThe value to set.

getLightCellsDataProvider()

The data provider for saving workbook in light mode.

getLightCellsDataProvider() : LightCellsDataProvider;

Returns

LightCellsDataProvider

setLightCellsDataProvider(LightCellsDataProvider)

The data provider for saving workbook in light mode.

setLightCellsDataProvider(value: LightCellsDataProvider) : void;

Parameters:

ParameterTypeDescription
valueLightCellsDataProviderThe value to set.

getTrimLeadingBlankRowAndColumn()

Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true.

getTrimLeadingBlankRowAndColumn() : boolean;

Remarks

Same with the rule in ms excel, a row/column will not be taken as blank if it has custom style, even if it contains no cell data. When saving with LightCells mode, this option takes no effect. User should control the output range by the implementation of LightCellsDataProvider or by speicifing ExportArea

setTrimLeadingBlankRowAndColumn(boolean)

Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true.

setTrimLeadingBlankRowAndColumn(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Same with the rule in ms excel, a row/column will not be taken as blank if it has custom style, even if it contains no cell data. When saving with LightCells mode, this option takes no effect. User should control the output range by the implementation of LightCellsDataProvider or by speicifing ExportArea

getTrimTailingBlankCells()

Indicates whether tailing blank cells in one row should be trimmed. Default is false.

getTrimTailingBlankCells() : boolean;

Remarks

When saving with LightCells mode and the ExportArea has not been specified, this option takes no effect and one row will be extended to just the last cell provided by the implementation LightCellsDataProvider

setTrimTailingBlankCells(boolean)

Indicates whether tailing blank cells in one row should be trimmed. Default is false.

setTrimTailingBlankCells(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

When saving with LightCells mode and the ExportArea has not been specified, this option takes no effect and one row will be extended to just the last cell provided by the implementation LightCellsDataProvider

getKeepSeparatorsForBlankRow()

Indicates whether separators should be output for blank row. Default value is false so by default the content for blank row will be empty.

getKeepSeparatorsForBlankRow() : boolean;

setKeepSeparatorsForBlankRow(boolean)

Indicates whether separators should be output for blank row. Default value is false so by default the content for blank row will be empty.

setKeepSeparatorsForBlankRow(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getExportArea()

The range of cells to be exported.

getExportArea() : CellArea;

Returns

CellArea

Remarks

If the exported area has been specified, TrimLeadingBlankRowAndColumn will takes no effect.

setExportArea(CellArea)

The range of cells to be exported.

setExportArea(value: CellArea) : void;

Parameters:

ParameterTypeDescription
valueCellAreaThe value to set.

Remarks

If the exported area has been specified, TrimLeadingBlankRowAndColumn will takes no effect.

getExportQuotePrefix()

Indicates whether the single quote sign should be exported as part of the value of one cell when Style.QuotePrefix is true for it. Default is false.

getExportQuotePrefix() : boolean;

setExportQuotePrefix(boolean)

Indicates whether the single quote sign should be exported as part of the value of one cell when Style.QuotePrefix is true for it. Default is false.

setExportQuotePrefix(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getExportAllSheets()

Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel.

getExportAllSheets() : boolean;

Remarks

The defult value is false.

setExportAllSheets(boolean)

Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel.

setExportAllSheets(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The defult value is false.

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.