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. |
Properties
Property | Type | Description |
---|---|---|
separator | string | Gets and sets char Delimiter of text file. |
separatorString | string | Gets and sets a string value as separator. |
encoding | EncodingType | Gets and sets the default encoding. |
quoteType | TxtValueQuoteType | Gets or sets how to quote values in the exported text file. |
formatStrategy | CellValueFormatStrategy | Gets and sets the format strategy when exporting the cell value as string. |
lightCellsDataProvider | LightCellsDataProvider | The data provider for saving workbook in light mode. |
trimLeadingBlankRowAndColumn | boolean | Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true. |
trimTailingBlankCells | boolean | Indicates whether tailing blank cells in one row should be trimmed. Default is false. |
keepSeparatorsForBlankRow | 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. |
exportArea | CellArea | The range of cells to be exported. |
exportQuotePrefix | 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. |
exportAllSheets | boolean | Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel. |
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 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. |
separator
Gets and sets char Delimiter of text file.
separator : string;
separatorString
Gets and sets a string value as separator.
separatorString : string;
encoding
Gets and sets the default encoding.
encoding : EncodingType;
quoteType
Gets or sets how to quote values in the exported text file.
quoteType : TxtValueQuoteType;
formatStrategy
Gets and sets the format strategy when exporting the cell value as string.
formatStrategy : CellValueFormatStrategy;
lightCellsDataProvider
The data provider for saving workbook in light mode.
lightCellsDataProvider : LightCellsDataProvider;
trimLeadingBlankRowAndColumn
Indicates whether leading blank rows and columns should be trimmed like what ms excel does. Default is true.
trimLeadingBlankRowAndColumn : 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
trimTailingBlankCells
Indicates whether tailing blank cells in one row should be trimmed. Default is false.
trimTailingBlankCells : 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
keepSeparatorsForBlankRow
Indicates whether separators should be output for blank row. Default value is false so by default the content for blank row will be empty.
keepSeparatorsForBlankRow : boolean;
exportArea
The range of cells to be exported.
exportArea : CellArea;
Remarks
If the exported area has been specified, TrimLeadingBlankRowAndColumn will takes no effect.
exportQuotePrefix
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.
exportQuotePrefix : boolean;
exportAllSheets
Indicates whether exporting all sheets to the text file. If it is false, only export the activesheet, just like MS Excel.
exportAllSheets : boolean;
Remarks
The defult value is false.
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.