aspose.cells

Class TxtLoadOptions

Represents the options for loading text file.

Constructor Summary
TxtLoadOptions()
Creates the options for loading text file.
TxtLoadOptions(loadFormat)
Creates the options for loading text file.
 
Property Getters/Setters Summary
functiongetAutoFitterOptions()
function
           Gets and sets the auto fitter options
functiongetCheckExcelRestriction()
function
           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 such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
functiongetConvertDateTimeData()
function
           Gets or sets a value that indicates whether the string in text file is converted to date data.
functiongetConvertNumericData()
function
           Gets or sets a value that indicates whether the string in text file is converted to numeric data.
functiongetEncoding()
function
           Gets and sets the default encoding.Only applies for csv file.
functiongetFontConfigs()
function
           Gets and sets individual font configs. Only works for the Workbook which uses this LoadOptions to load.>
functionhasFormula()
function
           Indicates whether the text is formula if it starts with "=".
functiongetIgnoreNotPrinted()
function
           Ignore the data which are not printed if directly printing the file
functiongetInterruptMonitor()
function
           Gets and sets the interrupt monitor.
functionisMultiEncoded()
function
           True means that the file contains several encoding.
functiongetKeepExactFormat()
function
           Indicates whether the exact formatting should be kept for the cell when converting string value to number or datetime. When ms excel loading datetime or numeric values from csv file, the formatting of those values may be changed, such as leading/tailing zeros of number, year/month/day order of datetime, ...etc. To simulate ms excel's behavior, please set this property to false. Default value of this property is true, so the cell value will be formatted as the same string value in csv template file.
functiongetLanguageCode()
function
           Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
functiongetLightCellsDataHandler()
function
           The data handler for processing cells data when reading template file.
functiongetLoadDataAndFormatting()
function
           If true, only loads data , formulas and formatting from the file, other contents and settings are all discarded. For example : shapes ,validation,conditional formatting,pivotables are not loaded.
functiongetLoadDataFilterOptions()
function
           The filter options to denote what data should be loaded. The value of the property is LoadDataFilterOptions integer constant.
functiongetLoadDataOnly()
function
           If true, only loads data and formulas from the file, other contents and settings are all discarded.
functiongetLoadDataOptions()
function
           Only effects when OnlyLoadData is true.
functiongetLoadFilter()
function
           The filter to denote how to load data.
functiongetLoadFormat()
Gets the load format. The value of the property is LoadFormat integer constant.
functiongetLoadStyleStrategy()
function
           Indicates the strategy to apply style for parsed values when converting string value to number or datetime. The value of the property is TxtLoadStyleStrategy integer constant.
functiongetLocale()
function
setLocale(value)
           Gets and sets the Locale used for workbook at the time the file was loaded.
functiongetMemorySetting()
function
           Gets or sets the memory usage options. The value of the property is MemorySetting integer constant.
functiongetOnlyLoadDocumentProperties()
function
           If true, only loads document properties
functiongetParsingFormulaOnOpen()
function
           Indicates whether parsing the formula when reading the file.
functiongetParsingPivotCachedRecords()
function
           Inidicates whether parsing pivot cached records when loadiing the file. The default value is false.
functiongetPassword()
function
           Gets and set the password of the workbook.
functiongetPreferredParsers()
function
           Gets and sets preferred value parsers for loading text file.
functiongetRegion()
function
setRegion(value)
           Gets or sets the system regional settings based on CountryCode at the time the file was loaded. The value of the property is CountryCode integer constant.
functiongetSeparator()
function
           Gets and sets character separator of text file.
functiongetSeparatorString()
function
           Gets and sets the a string value as separator.
functiongetStandardFont()
function
           Sets the default standard font name
functiongetStandardFontSize()
function
           Sets the default standard font size.
functiongetTreatConsecutiveDelimitersAsOne()
function
           Whether consecutive delimiters should be treated as one.
 
Method Summary
functionsetPaperSize(type)
Sets the default print paper size from default printer's setting.
 

    • Constructor Detail

      • TxtLoadOptions

        function TxtLoadOptions()
        Creates the options for loading text file. The default load file type is CSV .
      • TxtLoadOptions

        function TxtLoadOptions(loadFormat)
        Creates the options for loading text file.
        Parameters:
        loadFormat: Number - A LoadFormat value. The loading format
    • Property Getters/Setters Detail

      • getConvertNumericData/setConvertNumericData : boolean 

        function getConvertNumericData() / function setConvertNumericData(value)
        
        Gets or sets a value that indicates whether the string in text file is converted to numeric data.
      • getSeparator/setSeparator : char 

        function getSeparator() / function setSeparator(value)
        
        Gets and sets character separator of text file.
      • getSeparatorString/setSeparatorString : String 

        function getSeparatorString() / function setSeparatorString(value)
        
        Gets and sets the a string value as separator.
      • getEncoding/setEncoding : Encoding 

        function getEncoding() / function setEncoding(value)
        
        Gets and sets the default encoding.Only applies for csv file.
      • isMultiEncoded/setMultiEncoded : boolean 

        function isMultiEncoded() / function setMultiEncoded(value)
        
        True means that the file contains several encoding.
      • getPreferredParsers/setPreferredParsers : ICustomParser[] 

        function getPreferredParsers() / function setPreferredParsers(value)
        
        Gets and sets preferred value parsers for loading text file. parsers[0] is the parser will be used for the first column in text template file, parsers[1] is the parser will be used for the second column, ...etc. The last one(parsers[parsers.length-1]) will be used for all other columns start from parsers.length-1. If one item is null, the corresponding column will be parsed by the default parser of Aspose.Cells.
      • getConvertDateTimeData/setConvertDateTimeData : boolean 

        function getConvertDateTimeData() / function setConvertDateTimeData(value)
        
        Gets or sets a value that indicates whether the string in text file is converted to date data.
      • getLoadStyleStrategy/setLoadStyleStrategy : Number 

        function getLoadStyleStrategy() / function setLoadStyleStrategy(value)
        
        Indicates the strategy to apply style for parsed values when converting string value to number or datetime. The value of the property is TxtLoadStyleStrategy integer constant.
      • hasFormula/setHasFormula : boolean 

        function hasFormula() / function setHasFormula(value)
        
        Indicates whether the text is formula if it starts with "=".
      • getTreatConsecutiveDelimitersAsOne/setTreatConsecutiveDelimitersAsOne : boolean 

        function getTreatConsecutiveDelimitersAsOne() / function setTreatConsecutiveDelimitersAsOne(value)
        
        Whether consecutive delimiters should be treated as one.
      • getKeepExactFormat/setKeepExactFormat : boolean 

        function getKeepExactFormat() / function setKeepExactFormat(value)
        
        Indicates whether the exact formatting should be kept for the cell when converting string value to number or datetime. When ms excel loading datetime or numeric values from csv file, the formatting of those values may be changed, such as leading/tailing zeros of number, year/month/day order of datetime, ...etc. To simulate ms excel's behavior, please set this property to false. Default value of this property is true, so the cell value will be formatted as the same string value in csv template file. NOTE: This member is now obsolete. Instead, please set LoadStyleStrategy property to TxtLoadStyleStrategy.BuiltIn to get same result with this property's false value and TxtLoadStyleStrategy.ExactFormat to get same result with this property's true value. This property will be removed 12 months later since February 2015. Aspose apologizes for any inconvenience you may have experienced.
      • getLoadFormat : Number 

        function getLoadFormat()
        
        Gets the load format. The value of the property is LoadFormat integer constant.
      • getPassword/setPassword : String 

        function getPassword() / function setPassword(value)
        
        Gets and set the password of the workbook.
      • getParsingFormulaOnOpen/setParsingFormulaOnOpen : boolean 

        function getParsingFormulaOnOpen() / function setParsingFormulaOnOpen(value)
        
        Indicates whether parsing the formula when reading the file. Only applies for Excel Xlsx, Xltx, Xltm and Xlsm file because the formulas in the files are stored with a string formula.
      • getParsingPivotCachedRecords/setParsingPivotCachedRecords : boolean 

        function getParsingPivotCachedRecords() / function setParsingPivotCachedRecords(value)
        
        Inidicates whether parsing pivot cached records when loadiing the file. The default value is false. Only applies for Excel Xlsx, Xltx, Xltm , Xlsm and xlsb file
      • getLoadDataAndFormatting/setLoadDataAndFormatting : boolean 

        function getLoadDataAndFormatting() / function setLoadDataAndFormatting(value)
        
        If true, only loads data , formulas and formatting from the file, other contents and settings are all discarded. For example : shapes ,validation,conditional formatting,pivotables are not loaded. NOTE: This member is now obsolete. Instead, please use LoadFilter property(LoadFilter = new LoadFilter(LoadDataFilterOptions.CellData). This property will be removed 12 months later since November 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getLoadDataOnly/setLoadDataOnly : boolean 

        function getLoadDataOnly() / function setLoadDataOnly(value)
        
        If true, only loads data and formulas from the file, other contents and settings are all discarded. NOTE: This member is now obsolete. Instead, please use LoadFilter property(LoadFilter = new LoadFilter(LoadDataFilterOptions.CellData). This property will be removed 12 months later since June 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getOnlyLoadDocumentProperties/setOnlyLoadDocumentProperties : boolean 

        function getOnlyLoadDocumentProperties() / function setOnlyLoadDocumentProperties(value)
        
        If true, only loads document properties Only for excel 97- 2003 xls file. If the file is encrypted, we still can get the document properties without password NOTE: This member is now obsolete. Instead, please use LoadFilter property(LoadFilter = new LoadFilter(LoadDataFilterOptions.DocumentProperties). This property will be removed 12 months later since November 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getLoadDataOptions/setLoadDataOptions : LoadDataOption 

        function getLoadDataOptions() / function setLoadDataOptions(value)
        
        Only effects when OnlyLoadData is true. NOTE: This member is now obsolete. Instead, please use LoadFilter property(User may extend LoadFilter to filter the worksheet and data). This property will be removed 12 months later since November 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getLanguageCode/setLanguageCode : Number 

        function getLanguageCode() / function setLanguageCode(value)
        
        Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
      • getRegion/setRegion : Number 

        function getRegion() / function setRegion(value)
        
        Gets or sets the system regional settings based on CountryCode at the time the file was loaded. The value of the property is CountryCode integer constant.If you do not want to use the region saved in the file, please reset it after reading the file.
      • getLocale/setLocale : Locale 

        function getLocale() / function setLocale(value)
        
        Gets and sets the Locale used for workbook at the time the file was loaded.
      • getStandardFont/setStandardFont : String 

        function getStandardFont() / function setStandardFont(value)
        
        Sets the default standard font name
      • getStandardFontSize/setStandardFontSize : Number 

        function getStandardFontSize() / function setStandardFontSize(value)
        
        Sets the default standard font size.
      • getInterruptMonitor/setInterruptMonitor : InterruptMonitor 

        function getInterruptMonitor() / function setInterruptMonitor(value)
        
        Gets and sets the interrupt monitor.
      • getIgnoreNotPrinted/setIgnoreNotPrinted : boolean 

        function getIgnoreNotPrinted() / function setIgnoreNotPrinted(value)
        
        Ignore the data which are not printed if directly printing the file Only for xlsx file.
      • getCheckExcelRestriction/setCheckExcelRestriction : boolean 

        function getCheckExcelRestriction() / function setCheckExcelRestriction(value)
        
        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 such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
      • getLoadFilter/setLoadFilter : LoadFilter 

        function getLoadFilter() / function setLoadFilter(value)
        
        The filter to denote how to load data.
      • getLoadDataFilterOptions/setLoadDataFilterOptions : Number 

        function getLoadDataFilterOptions() / function setLoadDataFilterOptions(value)
        
        The filter options to denote what data should be loaded. The value of the property is LoadDataFilterOptions integer constant. NOTE: This member is now obsolete. Instead, please use LoadFilter property(LoadFilter = new LoadFilter(LoadDataFilterOptions). This property will be removed 12 months later since November 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getLightCellsDataHandler/setLightCellsDataHandler : LightCellsDataHandler 

        function getLightCellsDataHandler() / function setLightCellsDataHandler(value)
        
        The data handler for processing cells data when reading template file.
      • getMemorySetting/setMemorySetting : Number 

        function getMemorySetting() / function setMemorySetting(value)
        
        Gets or sets the memory usage options. The value of the property is MemorySetting integer constant.
      • getAutoFitterOptions/setAutoFitterOptions : AutoFitterOptions 

        function getAutoFitterOptions() / function setAutoFitterOptions(value)
        
        Gets and sets the auto fitter options Only for xlsx file now.
      • getFontConfigs/setFontConfigs : IndividualFontConfigs 

        function getFontConfigs() / function setFontConfigs(value)
        
        Gets and sets individual font configs. Only works for the Workbook which uses this LoadOptions to load.>
    • Method Detail

      • setPaperSize

        function setPaperSize(type)
        Sets the default print paper size from default printer's setting. If there is no setting about paper size,MS Excel will use default printer's setting.
        Parameters:
        type: Number - A PaperSizeType value. The default paper size.