aspose.cells

Class CellsHelper

Provides helper functions.

Property Getters/Setters Summary
static functiongetAltStartPath()
staticfunction
           Gets or sets the alternate startup path, which is referred to by some external formula references.
static functiongetCustomImplementationFactory()
staticfunction
           Gets or sets the factory for creating instances with special implementation.
static functiongetDPI()
staticfunction
setDPI(value)
           Gets the DPI of the machine.
static functionisCloudPlatform()
staticfunction
           Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
static functiongetLibraryPath()
staticfunction
           Gets or sets the library path which is referred to by some external formula references.
static functiongetSignificantDigits()
staticfunction
           Gets and sets the number of significant digits. The default value is 17.
static functiongetStartupPath()
staticfunction
           Gets or sets the startup path, which is referred to by some external formula references.
 
Method Summary
static functionaddAddInFunction(function, minCountOfParameters, maxCountOfParameters, paramersType, functionValueType)
Add addin function.
static functioncellIndexToName(row, column)
Gets cell name according to its row and column indexes.
static functioncellNameToIndex(cellName)
Gets the cell row and column indexes according to its name.
static functioncolumnIndexToName(column)
Gets column name according to column index.
static functioncolumnNameToIndex(columnName)
Gets column index according to column name.
static functionconvertA1FormulaToR1C1(formula, row, column)
Converts A1 formula of the cell to the r1c1 formula.
static functionconvertR1C1FormulaToA1(r1c1Formula, row, column)
Converts the r1c1 formula of the cell to A1 formula.
static functioncreateSafeSheetName(nameProposal)
Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with ' ', then return the rebuilt string value.
static functioncreateSafeSheetName(nameProposal, replaceChar)
Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with given character, then return the rebuilt string value.
static functiongetDateTimeFromDouble(doubleValue, date1904)
Convert the double value to the date time value.
static functiongetDoubleFromDateTime(dateTime, date1904)
Convert the date time to double value.
static functiongetTextWidth(text, font, scaling)
Get width of text in unit of points.
static functiongetUsedColors(workbook)
Gets all used colors in the workbook.
static functiongetVersion()
Get the release version.
static functionmergeFiles(files, cachedFile, destFile)
Merges some large xls files to a xls file.
static functionrowIndexToName(row)
Gets row name according to row index.
static functionrowNameToIndex(rowName)
Gets row index according to row name.
 

    • Property Getters/Setters Detail

      • getSignificantDigits/setSignificantDigits : Number 

        function static getSignificantDigits() / function static setSignificantDigits(value)
        
        Gets and sets the number of significant digits. The default value is 17. Only could be 15 or 17 now.
      • getDPI/setDPI : Number 

        function static getDPI() / function static setDPI(value)
        
        Gets the DPI of the machine.
      • getStartupPath/setStartupPath : String 

        function static getStartupPath() / function static setStartupPath(value)
        
        Gets or sets the startup path, which is referred to by some external formula references.
      • getAltStartPath/setAltStartPath : String 

        function static getAltStartPath() / function static setAltStartPath(value)
        
        Gets or sets the alternate startup path, which is referred to by some external formula references.
      • getLibraryPath/setLibraryPath : String 

        function static getLibraryPath() / function static setLibraryPath(value)
        
        Gets or sets the library path which is referred to by some external formula references.
      • getCustomImplementationFactory/setCustomImplementationFactory : CustomImplementationFactory 

        function static getCustomImplementationFactory() / function static setCustomImplementationFactory(value)
        
        Gets or sets the factory for creating instances with special implementation.
      • isCloudPlatform/setCloudPlatform : boolean 

        function static isCloudPlatform() / function static setCloudPlatform(value)
        
        Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
    • Method Detail

      • getTextWidth

        static function getTextWidth(text, font, scaling)
        Get width of text in unit of points.
        Parameters:
        text: String - The text.
        font: Font - The font of the text.
        scaling: Number - The scaling of text.
        Returns:
      • getVersion

        static function getVersion()
        Get the release version.
        Returns:
        The release version.
      • cellNameToIndex

        static function cellNameToIndex(cellName)
        Gets the cell row and column indexes according to its name.
        Parameters:
        cellName: String - Name of cell
        Returns:
        [0] is the row index and [1] is the column index.
      • cellIndexToName

        static function cellIndexToName(row, column)
        Gets cell name according to its row and column indexes.
        Parameters:
        row: Number - Row index.
        column: Number - Column index.
        Returns:
        Name of cell.
      • columnIndexToName

        static function columnIndexToName(column)
        Gets column name according to column index.
        Parameters:
        column: Number - Column index.
        Returns:
        Name of column.
      • columnNameToIndex

        static function columnNameToIndex(columnName)
        Gets column index according to column name.
        Parameters:
        columnName: String - Column name.
        Returns:
        Column index.
      • rowIndexToName

        static function rowIndexToName(row)
        Gets row name according to row index.
        Parameters:
        row: Number - Row index.
        Returns:
        Name of row.
      • rowNameToIndex

        static function rowNameToIndex(rowName)
        Gets row index according to row name.
        Parameters:
        rowName: String - Row name.
        Returns:
        Row index.
      • convertR1C1FormulaToA1

        static function convertR1C1FormulaToA1(r1c1Formula, row, column)
        Converts the r1c1 formula of the cell to A1 formula.
        Parameters:
        r1c1Formula: String - The r1c1 formula.
        row: Number - The row index of the cell.
        column: Number - The column index of the cell.
        Returns:
        The A1 formula.
      • convertA1FormulaToR1C1

        static function convertA1FormulaToR1C1(formula, row, column)
        Converts A1 formula of the cell to the r1c1 formula.
        Parameters:
        formula: String - The A1 formula.
        row: Number - The row index of the cell.
        column: Number - The column index of the cell.
        Returns:
        The R1C1 formula.
      • getDateTimeFromDouble

        static function getDateTimeFromDouble(doubleValue, date1904)
        Convert the double value to the date time value.
        Parameters:
        doubleValue: Number - The double value.
        date1904: boolean - Date 1904 system.
        Returns:
      • getDoubleFromDateTime

        static function getDoubleFromDateTime(dateTime, date1904)
        Convert the date time to double value.
        Parameters:
        dateTime: DateTime - The date time.
        date1904: boolean - Date 1904 system.
        Returns:
      • getUsedColors

        static function getUsedColors(workbook)
        Gets all used colors in the workbook.
        Parameters:
        workbook: Workbook - The workbook object.
        Returns:
        The used colors.
      • addAddInFunction

        static function addAddInFunction(function, minCountOfParameters, maxCountOfParameters, paramersType, functionValueType)
        Add addin function. NOTE: This member is now obsolete. Instead, please use WorksheetCollection.RegisterAddInFunction() methods. This method will be removed 12 months later since January 2022. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        function: String - The function name.
        minCountOfParameters: Number - Minimum number of parameters this function requires
        maxCountOfParameters: Number - Maximum number of parameters this function allows.
        paramersType: Number Array - The excepted parameters type of the function
        functionValueType: Number - A ParameterType value. The function value type.
      • mergeFiles

        static function mergeFiles(files, cachedFile, destFile)
        Merges some large xls files to a xls file. This method only supports merging data, style and formulas to the new file. The cached file is used to store some temporary data.
        Parameters:
        files: String[] - The files.
        cachedFile: String - The cached file.
        destFile: String - The dest file.
      • createSafeSheetName

        static function createSafeSheetName(nameProposal)
        Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with ' ', then return the rebuilt string value.
        Parameters:
        nameProposal: String - sheet name to be used
        Returns:
      • createSafeSheetName

        static function createSafeSheetName(nameProposal, replaceChar)
        Checks given sheet name and create a valid one when needed. If given sheet name conforms to the rules of excel sheet name, then return it. Otherwise string will be truncated if length exceeds the limit and invalid characters will be replaced with given character, then return the rebuilt string value.
        Parameters:
        nameProposal: String - sheet name to be used
        replaceChar: char - character which will be used to replace invalid characters in given sheet name
        Returns: