Class CellsHelper
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Provides helper functions.
public class CellsHelper
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
AltStartPath
Gets or sets the alternate startup path, which is referred to by some external formula references.
public static string AltStartPath { get; set; }
Property Value
CustomImplementationFactory
Gets or sets the factory for creating instances with special implementation.
public static CustomImplementationFactory CustomImplementationFactory { get; set; }
Property Value
DPI
Gets the DPI of the machine.
public static double DPI { get; set; }
Property Value
IsCloudPlatform
Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
public static bool IsCloudPlatform { get; set; }
Property Value
LibraryPath
Gets or sets the library path which is referred to by some external formula references.
public static string LibraryPath { get; set; }
Property Value
SignificantDigits
Gets and sets the number of significant digits. The default value is 17.
public static int SignificantDigits { get; set; }
Property Value
Remarks
Only could be 15 or 17 now.
StartupPath
Gets or sets the startup path, which is referred to by some external formula references.
public static string StartupPath { get; set; }
Property Value
Methods
CellIndexToName(int, int)
Gets cell name according to its row and column indexes.
public static string CellIndexToName(int row, int column)
Parameters
row
int
Row index.
column
int
Column index.
Returns
Name of cell.
CellNameToIndex(string, out int, out int)
Gets the cell row and column indexes according to its name.
public static void CellNameToIndex(string cellName, out int row, out int column)
Parameters
cellName
string
Name of cell.
row
int
Output row index
column
int
Output column index
ColumnIndexToName(int)
Gets column name according to column index.
public static string ColumnIndexToName(int column)
Parameters
column
int
Column index.
Returns
Name of column.
ColumnNameToIndex(string)
Gets column index according to column name.
public static int ColumnNameToIndex(string columnName)
Parameters
columnName
string
Column name.
Returns
Column index.
CreateSafeSheetName(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.
public static string CreateSafeSheetName(string nameProposal)
Parameters
nameProposal
string
sheet name to be used
Returns
CreateSafeSheetName(string, char)
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.
public static string CreateSafeSheetName(string nameProposal, char replaceChar)
Parameters
nameProposal
string
sheet name to be used
replaceChar
char
character which will be used to replace invalid characters in given sheet name
Returns
GetDateTimeFromDouble(double, bool)
Convert the double value to the date time value.
public static DateTime GetDateTimeFromDouble(double doubleValue, bool date1904)
Parameters
doubleValue
double
The double value.
date1904
bool
Date 1904 system.
Returns
GetDoubleFromDateTime(DateTime, bool)
Convert the date time to double value.
public static double GetDoubleFromDateTime(DateTime dateTime, bool date1904)
Parameters
dateTime
DateTime
The date time.
date1904
bool
Date 1904 system.
Returns
GetTextWidth(string, Font, double)
Get width of text in unit of points.
public static double GetTextWidth(string text, Font font, double scaling)
Parameters
text
string
The text.
font
Font
The font of the text.
scaling
double
The scaling of text.
Returns
GetUsedColors(Workbook)
Gets all used colors in the workbook.
public static Color[] GetUsedColors(Workbook workbook)
Parameters
workbook
Workbook
The workbook object.
Returns
Color[]
The used colors.
GetVersion()
Get the release version.
public static string GetVersion()
Returns
The release version.
InitForDotNetCore()
Do the initialization for .NetCore programme. We suggest you to call this method for all .NetCore initialization first. For example: CellsHelper.InitForDotNetCore(); Workbook wb = new Workbook();
public static void InitForDotNetCore()
MergeFiles(string[], string, string)
Merges some large xls files to a xls file.
public static void MergeFiles(string[] files, string cachedFile, string destFile)
Parameters
files
string[]
The files.
cachedFile
string
The cached file.
destFile
string
The dest 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.
NeedQuoteInFormula(string)
Indicates whether the name of the sheet should be enclosed in single quotes
public static bool NeedQuoteInFormula(string sheetName)
Parameters
sheetName
string
The name of the sheet
Returns
RowIndexToName(int)
Gets row name according to row index.
public static string RowIndexToName(int row)
Parameters
row
int
Row index.
Returns
Name of row.
RowNameToIndex(string)
Gets row index according to row name.
public static int RowNameToIndex(string rowName)
Parameters
rowName
string
Row name.
Returns
Row index.