asposecells.api

Class CellsHelper

Provides helper functions.

Property Getters/Setters Summary
static methodgetAltStartPath()
staticmethod
           Gets or sets the alternate startup path, which is referred to by some external formula references.
static methodgetCustomImplementationFactory()
staticmethod
           Gets or sets the factory for creating instances with special implementation.
static methodgetDPI()
staticmethod
setDPI(value)
           Gets the DPI of the machine.
static methodisCloudPlatform()
staticmethod
           Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
static methodgetLibraryPath()
staticmethod
           Gets or sets the library path which is referred to by some external formula references.
static methodgetSignificantDigits()
staticmethod
           Gets and sets the number of significant digits. The default value is 17.
static methodgetStartupPath()
staticmethod
           Gets or sets the startup path, which is referred to by some external formula references.
 
Method Summary
static methodaddAddInFunction(function, minCountOfParameters, maxCountOfParameters, paramersType, functionValueType)
Add addin function.
static methodcellIndexToName(row, column)
Gets cell name according to its row and column indexes.
static methodcellNameToIndex(cellName)
Gets the cell row and column indexes according to its name.
static methodcolumnIndexToName(column)
Gets column name according to column index.
static methodcolumnNameToIndex(columnName)
Gets column index according to column name.
static methodconvertA1FormulaToR1C1(formula, row, column)
Converts A1 formula of the cell to the r1c1 formula.
static methodconvertR1C1FormulaToA1(r1c1Formula, row, column)
Converts the r1c1 formula of the cell to A1 formula.
static methodcreateSafeSheetName(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 methodcreateSafeSheetName(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 methodgetDateTimeFromDouble(doubleValue, date1904)
Convert the double value to the date time value.
static methodgetDoubleFromDateTime(dateTime, date1904)
Convert the date time to double value.
static methodgetTextWidth(text, font, scaling)
Get width of text in unit of points.
static methodgetUsedColors(workbook)
Gets all used colors in the workbook.
static methodgetVersion()
Get the release version.
static methodmergeFiles(files, cachedFile, destFile)
Merges some large xls files to a xls file.
static methodneedQuoteInFormula(sheetName)
Indicates whether the name of the sheet should be enclosed in single quotes
static methodrowIndexToName(row)
Gets row name according to row index.
static methodrowNameToIndex(rowName)
Gets row index according to row name.
 

    • Property Getters/Setters Detail

      • getSignificantDigits/setSignificantDigits : int 

        static int getSignificantDigits() / 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 : float 

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

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

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

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

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

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

      • getTextWidth

        static float 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: float - The scaling of text.
        Returns:
      • getVersion

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

        static int[] 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 String cellIndexToName(row, column)
        Gets cell name according to its row and column indexes.
        Parameters:
        row: int - Row index.
        column: int - Column index.
        Returns:
        Name of cell.
      • columnIndexToName

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

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

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

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

        static String convertR1C1FormulaToA1(r1c1Formula, row, column)
        Converts the r1c1 formula of the cell to A1 formula. NOTE: This member is now obsolete. Instead, please use Worksheet.ConvertFormulaReferenceStyle() method. This property will be removed 12 months later since August 2023. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        r1c1Formula: String - The r1c1 formula.
        row: int - The row index of the cell.
        column: int - The column index of the cell.
        Returns:
        The A1 formula.
      • convertA1FormulaToR1C1

        static String convertA1FormulaToR1C1(formula, row, column)
        Converts A1 formula of the cell to the r1c1 formula. NOTE: This member is now obsolete. Instead, please use Worksheet.ConvertFormulaReferenceStyle() method. This property will be removed 12 months later since August 2023. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        formula: String - The A1 formula.
        row: int - The row index of the cell.
        column: int - The column index of the cell.
        Returns:
        The R1C1 formula.
      • getDateTimeFromDouble

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

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

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

        static  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: int - Minimum number of parameters this function requires
        maxCountOfParameters: int - Maximum number of parameters this function allows.
        paramersType: Number Array - The excepted parameters type of the function
        functionValueType: int - A ParameterType value. The function value type.
      • mergeFiles

        static  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 String 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 String 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:
      • needQuoteInFormula

        static boolean needQuoteInFormula(sheetName)
        Indicates whether the name of the sheet should be enclosed in single quotes
        Parameters:
        sheetName: String - The name of the sheet
        Returns: