asposecells.api
Class CellsHelper

Provides helper functions.

Property Getters/Setters Summary
static methodgetAltStartPath()
static methodsetAltStartPath(value)
           Gets or sets the alternate startup path, which is referred to by some external formula references.
static methodgetCustomImplementationFactory()
static methodsetCustomImplementationFactory(value)
           Gets or sets the factory for creating instances with special implementation.
static methodgetDPI()
static methodsetDPI(value)
           Gets the DPI of the machine.
static methodgetFontDir()
static methodsetFontDir(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 methodgetFontDirs()
static methodsetFontDirs(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.
static methodgetFontFiles()
static methodsetFontFiles(value)
           When generating PDF/XPS, specific font files can be set in the property. Such as "d:\myfonts\myArial.ttf"
static methodgetLibraryPath()
static methodsetLibraryPath(value)
           Gets or sets the library path which is referred to by some external formula references.
static methodgetSignificantDigits()
static methodsetSignificantDigits(value)
           Gets and sets the number of significant digits. The default value is 17.
static methodgetStartupPath()
static methodsetStartupPath(value)
           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)
          
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 methoddetectFileFormat(stream)
           Detects the format type of the file stored in the stream.
static methoddetectFileFormat(fileName)
           Detects the file format type.
static methoddetectLoadFormat(stream)
           Detects the file load format.
static methoddetectLoadFormat(fileName)
           Detects the file load format.
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 methodisProtectedByRMS(stream)
           Gets whether the file is protected by Microsoft Rights Management Server.
static methodisProtectedByRMS(fileName)
           Gets whether the file is protected by Microsoft Rights Management Server.
static methodmergeFiles(files, cachedFile, destFile)
           Merges some large xls files to a xls file.
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.

getFontDir/setFontDir : String 

static String getFontDir() / 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 

static ArrayList getFontDirs() / 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 

static ArrayList getFontFiles() / 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 

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.

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.

isProtectedByRMS

static boolean 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 boolean 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 int[] cellNameToIndex(cellName)

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.
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.
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:

detectLoadFormat

static int 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 int 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 int 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 int 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 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.
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:

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.