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 functiongetFontDir()
staticfunction
setFontDir(value)
           When generating PDF/XPS, specific font file directory can be set in the property. If it is not set , using %WINDOWS%\fonts by default.
static functiongetFontDirs()
staticfunction
           When generating PDF/XPS, specific font file directories can be set in the property. If it is not set , using %WINDOWS%\fonts by default.
static functiongetFontFiles()
staticfunction
           When generating PDF/XPS, specific font files can be set in the property. Such as "d:\myfonts\myArial.ttf"
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)
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 functiondetectFileFormat(stream)
Detects the format type of the file stored in the stream.
static functiondetectFileFormat(fileName)
Detects the file format type.
static functiondetectLoadFormat(stream)
Detects the file load format.
static functiondetectLoadFormat(fileName)
Detects the file load format.
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 functiongetUsedColors(workbook)
Gets all used colors in the workbook.
static functiongetVersion()
Get the release version.
static functionisProtectedByRMS(stream)
Gets whether the file is protected by Microsoft Rights Management Server.
static functionisProtectedByRMS(fileName)
Gets whether the file is protected by Microsoft Rights Management Server.
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.
      • getFontDir/setFontDir : String 

        function static getFontDir() / function static setFontDir(value)
        
        When generating PDF/XPS, specific font file directory can be set in the property. If it is not set , using %WINDOWS%\fonts by default. This member is now obsolete. Instead, please use FontConfigs.setFontFolder(java.lang.String, boolean) method with folder recursive to false. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getFontDirs/setFontDirs : ArrayList 

        function static getFontDirs() / function static setFontDirs(value)
        
        When generating PDF/XPS, specific font file directories can be set in the property. If it is not set , using %WINDOWS%\fonts by default. This member is now obsolete. Instead, please use FontConfigs.setFontFolders(java.lang.String[], boolean) method with folder recursive to false. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getFontFiles/setFontFiles : ArrayList 

        function static getFontFiles() / function static setFontFiles(value)
        
        When generating PDF/XPS, specific font files can be set in the property. Such as "d:\myfonts\myArial.ttf" This member is now obsolete. Instead, please use FontConfigs.setFontSources(com.aspose.cells.FontSourceBase[]) method. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.
      • 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.
    • Method Detail

      • getVersion

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

        static function isProtectedByRMS(fileName)
        Gets whether the file is protected by Microsoft Rights Management Server. This member is now obsolete. Instead, please use FileFormatUtil.detectFileFormat(java.lang.String) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        fileName: String - The file name.
        Returns:
      • isProtectedByRMS

        static function isProtectedByRMS(stream)
        Gets whether the file is protected by Microsoft Rights Management Server. This member is now obsolete. Instead, please use #Error Cref: M:Aspose.Cells.FileFormatUtil.DetectFileFormat(System.IO.Stream) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        stream: InputStream - The file stream.
        Returns:
      • cellNameToIndex

        static function cellNameToIndex(cellName)
      • 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:
      • detectLoadFormat

        static function detectLoadFormat(fileName)
        Detects the file load format. This member is now obsolete. Instead, please use FileFormatUtil.detectFileFormat(java.lang.String) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        fileName: String - The file name.
        Returns:
        A LoadFormat value. The load format.
      • detectLoadFormat

        static function detectLoadFormat(stream)
        Detects the file load format. This member is now obsolete. Instead, please use FileFormatUtil.detectFileFormat(java.lang.String) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        stream: InputStream - The stream.
        Returns:
        A LoadFormat value.
      • detectFileFormat

        static function detectFileFormat(fileName)
        Detects the file format type. This member is now obsolete. Instead, please use FileFormatUtil.detectFileFormat(java.lang.String) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        fileName: String - the file name
        Returns:
        A FileFormatType value. The file format type.
      • detectFileFormat

        static function detectFileFormat(stream)
        Detects the format type of the file stored in the stream. This member is now obsolete. Instead, please use #Error Cref: M:Aspose.Cells.FileFormatUtil.DetectFileFormat(System.IO.Stream) property. This property will be removed 12 months later since December 2013. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        stream: InputStream - The stream
        Returns:
        A FileFormatType value. The file format type.
      • 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.
        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: