CellsHelper
Source: aspose.
Provides helper functions.
Methods
- setLibraryPath()
- setSignificantDigits()
- setStartupPath()
- addAddInFunction(function, minCountOfParameters, maxCountOfParameters, paramersType, functionValueType)
- cellIndexToName(row, column)
- cellNameToIndex(cellName)
- columnIndexToName(column)
- columnNameToIndex(columnName)
- convertA1FormulaToR1C1(formula, row, column)
- convertR1C1FormulaToA1(r1c1Formula, row, column)
- createSafeSheetName(nameProposal)
- createSafeSheetName(nameProposal, replaceChar)
- getDateTimeFromDouble(doubleValue, date1904)
- getDoubleFromDateTime(dateTime, date1904)
- getTextWidth(text, font, scaling)
- getUsedColors(workbook)
- getVersion()
- mergeFiles(files, cachedFile, destFile)
- needQuoteInFormula(sheetName)
- rowIndexToName(row)
- rowNameToIndex(rowName)
Methods
getAltStartPath()
Gets or sets the alternate startup path, which is referred to by some external formula references.
getCustomImplementationFactory()
Gets or sets the factory for creating instances with special implementation.
getDPI()
Gets the DPI of the machine.
getLibraryPath()
Gets or sets the library path which is referred to by some external formula references.
getSignificantDigits()
Gets and sets the number of significant digits. The default value is 17. Only could be 15 or 17 now.
getStartupPath()
Gets or sets the startup path, which is referred to by some external formula references.
isCloudPlatform()
Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
setAltStartPath()
Gets or sets the alternate startup path, which is referred to by some external formula references.
setCloudPlatform()
Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
setCustomImplementationFactory()
Gets or sets the factory for creating instances with special implementation.
setDPI()
Gets the DPI of the machine.
setLibraryPath()
Gets or sets the library path which is referred to by some external formula references.
setSignificantDigits()
Gets and sets the number of significant digits. The default value is 17. Only could be 15 or 17 now.
setStartupPath()
Gets or sets the startup path, which is referred to by some external formula references.
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
Name | Type | Optional | Description |
---|---|---|---|
function |
String |
|
The function name. |
minCountOfParameters |
Number |
|
Minimum number of parameters this function requires |
maxCountOfParameters |
Number |
|
Maximum number of parameters this function allows. |
paramersType |
Array of Number |
|
The excepted parameters type of the function |
functionValueType |
Number |
|
ParameterType |
cellIndexToName(row, column) → String
Gets cell name according to its row and column indexes.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
row |
Number |
|
Row index. |
column |
Number |
|
Column index. |
- Returns
-
String
Name of cell.
cellNameToIndex(cellName) → Array of Number
Gets the cell row and column indexes according to its name.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
cellName |
String |
|
Name of cell |
- Returns
-
Array of Number
[0] is the row index and [1] is the column index.
columnIndexToName(column) → String
Gets column name according to column index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
column |
Number |
|
Column index. |
- Returns
-
String
Name of column.
columnNameToIndex(columnName) → Number
Gets column index according to column name.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
columnName |
String |
|
Column name. |
- Returns
-
Number
Column index.
convertA1FormulaToR1C1(formula, row, column) → String
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
Name | Type | Optional | Description |
---|---|---|---|
formula |
String |
|
The A1 formula. |
row |
Number |
|
The row index of the cell. |
column |
Number |
|
The column index of the cell. |
- Returns
-
String
The R1C1 formula.
convertR1C1FormulaToA1(r1c1Formula, row, column) → String
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
Name | Type | Optional | Description |
---|---|---|---|
r1c1Formula |
String |
|
The r1c1 formula. |
row |
Number |
|
The row index of the cell. |
column |
Number |
|
The column index of the cell. |
- Returns
-
String
The A1 formula.
createSafeSheetName(nameProposal) → String
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.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
nameProposal |
String |
|
sheet name to be used |
- Returns
-
String
createSafeSheetName(nameProposal, replaceChar) → String
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
Name | Type | Optional | Description |
---|---|---|---|
nameProposal |
String |
|
sheet name to be used |
replaceChar |
char |
|
character which will be used to replace invalid characters in given sheet name |
- Returns
-
String
getDateTimeFromDouble(doubleValue, date1904) → DateTime
Convert the double value to the date time value.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
doubleValue |
Number |
|
The double value. |
date1904 |
boolean |
|
Date 1904 system. |
- Returns
getDoubleFromDateTime(dateTime, date1904) → Number
Convert the date time to double value.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dateTime |
|
The date time. |
|
date1904 |
boolean |
|
Date 1904 system. |
- Returns
-
Number
getTextWidth(text, font, scaling) → Number
Get width of text in unit of points.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
text |
String |
|
The text. |
font |
|
The font of the text. |
|
scaling |
Number |
|
The scaling of text. |
- Returns
-
Number
getUsedColors(workbook) → Array of Color
Gets all used colors in the workbook.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
workbook |
|
The workbook object. |
- Returns
-
Array of Color
The used colors.
getVersion() → String
Get the release version.
- Returns
-
String
The release version.
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
Name | Type | Optional | Description |
---|---|---|---|
files |
Array of String |
|
The files. |
cachedFile |
String |
|
The cached file. |
destFile |
String |
|
The dest file. |
needQuoteInFormula(sheetName) → boolean
Indicates whether the name of the sheet should be enclosed in single quotes
Parameter
Name | Type | Optional | Description |
---|---|---|---|
sheetName |
String |
|
The name of the sheet |
- Returns
-
boolean
rowIndexToName(row) → String
Gets row name according to row index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
row |
Number |
|
Row index. |
- Returns
-
String
Name of row.
rowNameToIndex(rowName) → Number
Gets row index according to row name.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
rowName |
String |
|
Row name. |
- Returns
-
Number
Row index.