TxtSaveOptions
TxtSaveOptions class
Represents the save options for csv/tab delimited/other text format.
class TxtSaveOptions extends SaveOptions;
Constructors
Name | Description |
---|---|
constructor() | Creates text file save options. |
constructor(SaveOptions) | Constructs from a parent object convertible to this. |
constructor(SaveFormat) | Creates text file save options. |
Methods
Method | Description |
---|---|
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. |
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 text file save options.
constructor();
constructor(SaveOptions)
Constructs from a parent object convertible to this.
constructor(obj: SaveOptions);
Parameters:
Parameter | Type | Description |
---|---|---|
obj | SaveOptions | The parent object. |
constructor(SaveFormat)
Creates text file save options.
constructor(saveFormat: SaveFormat);
Parameters:
Parameter | Type | Description |
---|---|---|
saveFormat | SaveFormat | The file format. /// It should be SaveFormat.Csv or SaveFormat.Tsv, /// 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:
Parameter | Type | Description |
---|---|---|
value | string | The 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:
Parameter | Type | Description |
---|---|---|
value | string | The value to set. |
getEncoding()
Gets and sets the default encoding.
getEncoding() : EncodingType;
Returns
setEncoding(EncodingType)
Gets and sets the default encoding.
setEncoding(value: EncodingType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | EncodingType | The value to set. |
getQuoteType()
Gets or sets how to quote values in the exported text file.
getQuoteType() : TxtValueQuoteType;
Returns
setQuoteType(TxtValueQuoteType)
Gets or sets how to quote values in the exported text file.
setQuoteType(value: TxtValueQuoteType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | TxtValueQuoteType | The value to set. |
getFormatStrategy()
Gets and sets the format strategy when exporting the cell value as string.
getFormatStrategy() : CellValueFormatStrategy;
Returns
setFormatStrategy(CellValueFormatStrategy)
Gets and sets the format strategy when exporting the cell value as string.
setFormatStrategy(value: CellValueFormatStrategy) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | CellValueFormatStrategy | The value to set. |
getLightCellsDataProvider()
The data provider for saving workbook in light mode.
getLightCellsDataProvider() : LightCellsDataProvider;
Returns
setLightCellsDataProvider(LightCellsDataProvider)
The data provider for saving workbook in light mode.
setLightCellsDataProvider(value: LightCellsDataProvider) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | LightCellsDataProvider | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getExportArea()
The range of cells to be exported.
getExportArea() : CellArea;
Returns
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:
Parameter | Type | Description |
---|---|---|
value | CellArea | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
Remarks
The defult value is false.
isNull()
Checks whether the implementation object is null.
isNull() : boolean;
getSaveFormat()
Gets the save file format.
getSaveFormat() : SaveFormat;
Returns
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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | string | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
setWarningCallback(IWarningCallback)
Gets or sets warning callback.
setWarningCallback(value: IWarningCallback) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | IWarningCallback | The value to set. |
getWarningCallback()
Gets or sets warning callback.
getWarningCallback() : IWarningCallback;
Returns
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:
Parameter | Type | Description |
---|---|---|
value | boolean | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
Remarks
Only for .xls,xlsx,xlsb and xlsm file.