Class CellsHelper

CellsHelper class

Provides helper functions.

public class CellsHelper

Properties

NameDescription
static AltStartPath { get; set; }Gets or sets the alternate startup path, which is referred to by some external formula references.
static CustomImplementationFactory { get; set; }Gets or sets the factory for creating instances with special implementation.
static DPI { get; set; }Gets the DPI of the machine.
static IsCloudPlatform { get; set; }Please set this property True when running on a cloud platform, such as: Azure, AWSLambda, etc,
static LibraryPath { get; set; }Gets or sets the library path which is referred to by some external formula references.
static SignificantDigits { get; set; }Gets and sets the number of significant digits. The default value is 17.
static StartupPath { get; set; }Gets or sets the startup path, which is referred to by some external formula references.

Methods

NameDescription
static AddAddInFunction(string, int, int, ParameterType[], ParameterType)(Obsolete.) Add addin function.
static CellIndexToName(int, int)Gets cell name according to its row and column indexes.
static CellNameToIndex(string, out int, out int)Gets the cell row and column indexes according to its name.
static ColumnIndexToName(int)Gets column name according to column index.
static ColumnNameToIndex(string)Gets column index according to column name.
static ConvertA1FormulaToR1C1(string, int, int)(Obsolete.) Converts A1 formula of the cell to the r1c1 formula.
static ConvertR1C1FormulaToA1(string, int, int)(Obsolete.) Converts the r1c1 formula of the cell to A1 formula.
static 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.
static 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.
static GetDateTimeFromDouble(double, bool)Convert the double value to the date time value.
static GetDoubleFromDateTime(DateTime, bool)Convert the date time to double value.
static GetTextWidth(string, Font, double)Get width of text in unit of points.
static GetUsedColors(Workbook)Gets all used colors in the workbook.
static GetVersion()Get the release version.
static MergeFiles(string[], string, string)Merges some large xls files to a xls file.
static NeedQuoteInFormula(string)Indicates whether the name of the sheet should be enclosed in single quotes
static RowIndexToName(int)Gets row name according to row index.
static RowNameToIndex(string)Gets row index according to row name.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class CellsHelperDemo
    {
        public static void CellsHelperExample()
        {
            // Setting properties of CellsHelper
            CellsHelper.SignificantDigits = 15;
            CellsHelper.DPI = 96.0;
            CellsHelper.StartupPath = "C:\\Program Files\\Aspose\\Cells";
            CellsHelper.AltStartPath = "D:\\Aspose\\Cells";
            CellsHelper.LibraryPath = "E:\\Aspose\\Cells\\Library";
            CellsHelper.IsCloudPlatform = true;

            // Assuming CustomImplementationFactory is already defined and instantiated elsewhere
            CellsHelper.CustomImplementationFactory = new CustomImplementationFactory();

            // Demonstrating the use of CellsHelper properties
            Console.WriteLine("Significant Digits: " + CellsHelper.SignificantDigits);
            Console.WriteLine("DPI: " + CellsHelper.DPI);
            Console.WriteLine("Startup Path: " + CellsHelper.StartupPath);
            Console.WriteLine("Alternate Startup Path: " + CellsHelper.AltStartPath);
            Console.WriteLine("Library Path: " + CellsHelper.LibraryPath);
            Console.WriteLine("Is Cloud Platform: " + CellsHelper.IsCloudPlatform);

            // Example of using CustomImplementationFactory
            var memoryStream = CellsHelper.CustomImplementationFactory.CreateMemoryStream();
            Console.WriteLine("MemoryStream created with CustomImplementationFactory: " + (memoryStream != null));

            return;
        }
    }
}

See Also