CellsHelper

Inheritance: java.lang.Object

public class CellsHelper

Provides helper functions.

Methods

MethodDescription
addAddInFunction(String function, int minCountOfParameters, int maxCountOfParameters, int[] paramersType, int functionValueType)Add addin function.
cellIndexToName(int row, int column)Gets cell name according to its row and column indexes.
cellNameToIndex(String cellName)Gets the cell row and column indexes according to its name.
columnIndexToName(int column)Gets column name according to column index.
columnNameToIndex(String columnName)Gets column index according to column name.
convertA1FormulaToR1C1(String formula, int row, int column)Converts A1 formula of the cell to the r1c1 formula.
convertR1C1FormulaToA1(String r1c1Formula, int row, int column)Converts the r1c1 formula of the cell to A1 formula.
createSafeSheetName(String nameProposal)Checks given sheet name and create a valid one when needed.
createSafeSheetName(String nameProposal, char replaceChar)Checks given sheet name and create a valid one when needed.
equals(Object arg0)
getAltStartPath()Gets the alternate startup path, which is referred to by some external formula references.
getClass()
getCustomImplementationFactory()Gets the factory for creating instances with special implementation.
getDPI()Gets the DPI of the machine.
getDateTimeFromDouble(double doubleValue, boolean date1904)Convert the double value to the date time value.
getDoubleFromDateTime(DateTime dateTime, boolean date1904)Convert the date time to double value.
getLibraryPath()Gets the library path which is referred to by some external formula references.
getSignificantDigits()Gets the number of significant digits.
getStartupPath()Gets the startup path, which is referred to by some external formula references.
getTextWidth(String text, Font font, double scaling)Get width of text in unit of points.
getUsedColors(Workbook workbook)Gets all used colors in the workbook.
getVersion()Get the release version.
hashCode()
isCloudPlatform()Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
mergeFiles(String[] files, String cachedFile, String destFile)Merges some large xls files to a xls file.
needQuoteInFormula(String sheetName)Indicates whether the name of the sheet should be enclosed in single quotes
notify()
notifyAll()
rowIndexToName(int row)Gets row name according to row index.
rowNameToIndex(String rowName)Gets row index according to row name.
setAltStartPath(String value)Sets the alternate startup path, which is referred to by some external formula references.
setCloudPlatform(boolean value)Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
setCustomImplementationFactory(CustomImplementationFactory value)Sets the factory for creating instances with special implementation.
setDPI(double value)Gets the DPI of the machine.
setLibraryPath(String value)Sets the library path which is referred to by some external formula references.
setSignificantDigits(int value)Sets the number of significant digits.
setStartupPath(String value)Sets the startup path, which is referred to by some external formula references.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

addAddInFunction(String function, int minCountOfParameters, int maxCountOfParameters, int[] paramersType, int functionValueType)

public static void addAddInFunction(String function, int minCountOfParameters, int maxCountOfParameters, int[] paramersType, int functionValueType)

Add addin function.

Remarks

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:

ParameterTypeDescription
functionjava.lang.StringThe function name.
minCountOfParametersintMinimum number of parameters this function requires
maxCountOfParametersintMaximum number of parameters this function allows.
paramersTypeint[]ParameterType. The excepted parameters type of the function
functionValueTypeintParameterType. The function value type.

cellIndexToName(int row, int column)

public static String cellIndexToName(int row, int column)

Gets cell name according to its row and column indexes.

Parameters:

ParameterTypeDescription
rowintRow index.
columnintColumn index.

Returns: java.lang.String - Name of cell.

cellNameToIndex(String cellName)

public static int[] cellNameToIndex(String cellName)

Gets the cell row and column indexes according to its name.

Parameters:

ParameterTypeDescription
cellNamejava.lang.StringName of cell

Returns: int[] - [0] is the row index and [1] is the column index.

columnIndexToName(int column)

public static String columnIndexToName(int column)

Gets column name according to column index.

Parameters:

ParameterTypeDescription
columnintColumn index.

Returns: java.lang.String - Name of column.

columnNameToIndex(String columnName)

public static int columnNameToIndex(String columnName)

Gets column index according to column name.

Parameters:

ParameterTypeDescription
columnNamejava.lang.StringColumn name.

Returns: int - Column index.

convertA1FormulaToR1C1(String formula, int row, int column)

public static String convertA1FormulaToR1C1(String formula, int row, int column)

Converts A1 formula of the cell to the r1c1 formula.

Remarks

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:

ParameterTypeDescription
formulajava.lang.StringThe A1 formula.
rowintThe row index of the cell.
columnintThe column index of the cell.

Returns: java.lang.String - The R1C1 formula.

convertR1C1FormulaToA1(String r1c1Formula, int row, int column)

public static String convertR1C1FormulaToA1(String r1c1Formula, int row, int column)

Converts the r1c1 formula of the cell to A1 formula.

Remarks

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:

ParameterTypeDescription
r1c1Formulajava.lang.StringThe r1c1 formula.
rowintThe row index of the cell.
columnintThe column index of the cell.

Returns: java.lang.String - The A1 formula.

createSafeSheetName(String nameProposal)

public static String createSafeSheetName(String 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:

ParameterTypeDescription
nameProposaljava.lang.Stringsheet name to be used

Returns: java.lang.String -

createSafeSheetName(String nameProposal, char replaceChar)

public static String createSafeSheetName(String nameProposal, char 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:

ParameterTypeDescription
nameProposaljava.lang.Stringsheet name to be used
replaceCharcharcharacter which will be used to replace invalid characters in given sheet name

Returns: java.lang.String -

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAltStartPath()

public static String getAltStartPath()

Gets the alternate startup path, which is referred to by some external formula references.

Returns: java.lang.String

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCustomImplementationFactory()

public static CustomImplementationFactory getCustomImplementationFactory()

Gets the factory for creating instances with special implementation.

Returns: CustomImplementationFactory

getDPI()

public static double getDPI()

Gets the DPI of the machine.

Remarks

Returns: double

getDateTimeFromDouble(double doubleValue, boolean date1904)

public static DateTime getDateTimeFromDouble(double doubleValue, boolean date1904)

Convert the double value to the date time value.

Parameters:

ParameterTypeDescription
doubleValuedoubleThe double value.
date1904booleanDate 1904 system.

Returns: DateTime -

getDoubleFromDateTime(DateTime dateTime, boolean date1904)

public static double getDoubleFromDateTime(DateTime dateTime, boolean date1904)

Convert the date time to double value.

Parameters:

ParameterTypeDescription
dateTimeDateTimeThe date time.
date1904booleanDate 1904 system.

Returns: double -

getLibraryPath()

public static String getLibraryPath()

Gets the library path which is referred to by some external formula references.

Returns: java.lang.String

getSignificantDigits()

public static int getSignificantDigits()

Gets the number of significant digits. The default value is 17.

Remarks

Only could be 15 or 17 now.

Returns: int

getStartupPath()

public static String getStartupPath()

Gets the startup path, which is referred to by some external formula references.

Returns: java.lang.String

getTextWidth(String text, Font font, double scaling)

public static double getTextWidth(String text, Font font, double scaling)

Get width of text in unit of points.

Parameters:

ParameterTypeDescription
textjava.lang.StringThe text.
fontFontThe font of the text.
scalingdoubleThe scaling of text.

Returns: double -

getUsedColors(Workbook workbook)

public static Color[] getUsedColors(Workbook workbook)

Gets all used colors in the workbook.

Parameters:

ParameterTypeDescription
workbookWorkbookThe workbook object.

Returns: com.aspose.cells.Color[] - The used colors.

getVersion()

public static String getVersion()

Get the release version.

Returns: java.lang.String - The release version.

hashCode()

public native int hashCode()

Returns: int

isCloudPlatform()

public static boolean isCloudPlatform()

Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,

Returns: boolean

mergeFiles(String[] files, String cachedFile, String destFile)

public static void mergeFiles(String[] files, String cachedFile, String destFile)

Merges some large xls files to a xls file.

Remarks

This method only supports merging data, style and formulas to the new file. The cached file is used to store some temporary data.

Parameters:

ParameterTypeDescription
filesjava.lang.String[]The files.
cachedFilejava.lang.StringThe cached file.
destFilejava.lang.StringThe dest file.

needQuoteInFormula(String sheetName)

public static boolean needQuoteInFormula(String sheetName)

Indicates whether the name of the sheet should be enclosed in single quotes

Parameters:

ParameterTypeDescription
sheetNamejava.lang.StringThe name of the sheet

Returns: boolean -

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

rowIndexToName(int row)

public static String rowIndexToName(int row)

Gets row name according to row index.

Parameters:

ParameterTypeDescription
rowintRow index.

Returns: java.lang.String - Name of row.

rowNameToIndex(String rowName)

public static int rowNameToIndex(String rowName)

Gets row index according to row name.

Parameters:

ParameterTypeDescription
rowNamejava.lang.StringRow name.

Returns: int - Row index.

setAltStartPath(String value)

public static void setAltStartPath(String value)

Sets the alternate startup path, which is referred to by some external formula references.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCloudPlatform(boolean value)

public static void setCloudPlatform(boolean value)

Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,

Parameters:

ParameterTypeDescription
valueboolean

setCustomImplementationFactory(CustomImplementationFactory value)

public static void setCustomImplementationFactory(CustomImplementationFactory value)

Sets the factory for creating instances with special implementation.

Parameters:

ParameterTypeDescription
valueCustomImplementationFactory

setDPI(double value)

public static void setDPI(double value)

Gets the DPI of the machine.

Remarks

Parameters:

ParameterTypeDescription
valuedouble

setLibraryPath(String value)

public static void setLibraryPath(String value)

Sets the library path which is referred to by some external formula references.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setSignificantDigits(int value)

public static void setSignificantDigits(int value)

Sets the number of significant digits. The default value is 17.

Remarks

Only could be 15 or 17 now.

Parameters:

ParameterTypeDescription
valueint

setStartupPath(String value)

public static void setStartupPath(String value)

Sets the startup path, which is referred to by some external formula references.

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int