Class CellsHelper

Class CellsHelper

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

提供辅助函数。

public class CellsHelper

继承

objectCellsHelper

继承成员

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

属性

AltStartPath

获取或设置备用启动路径,该路径被某些外部公式引用。

public static string AltStartPath { get; set; }

属性值

string

CustomImplementationFactory

获取或设置用于创建具有特殊实现的实例的工厂。

public static CustomImplementationFactory CustomImplementationFactory { get; set; }

属性值

CustomImplementationFactory

DPI

获取机器的 DPI。

public static double DPI { get; set; }

属性值

double

IsCloudPlatform

在云平台上运行时,请将此属性设置为 True,例如:Azure、AWSLambda 等。

public static bool IsCloudPlatform { get; set; }

属性值

bool

LibraryPath

获取或设置库路径,该路径被某些外部公式引用。

public static string LibraryPath { get; set; }

属性值

string

SignificantDigits

获取和设置有效数字的数量。 默认值为 17。

public static int SignificantDigits { get; set; }

属性值

int

备注

现在只能为 15 或 17。

StartupPath

获取或设置启动路径,该路径被某些外部公式引用。

public static string StartupPath { get; set; }

属性值

string

方法

CellIndexToName(int, int)

根据行和列索引获取单元格名称。

public static string CellIndexToName(int row, int column)

参数

row int

行索引。

column int

列索引。

返回

string

单元格名称。

CellNameToIndex(string, out int, out int)

根据名称获取单元格的行和列索引。

public static void CellNameToIndex(string cellName, out int row, out int column)

参数

cellName string

单元格名称。

row int

输出行索引

column int

输出列索引

ColumnIndexToName(int)

根据列索引获取列名称。

public static string ColumnIndexToName(int column)

参数

column int

列索引。

返回

string

列名称。

ColumnNameToIndex(string)

根据列名称获取列索引。

public static int ColumnNameToIndex(string columnName)

参数

columnName string

列名称。

返回

int

列索引。

CreateSafeSheetName(string)

检查给定的工作表名称,并在需要时创建一个有效的名称。 如果给定的工作表名称符合 Excel 工作表名称的规则,则返回该名称。 否则,如果长度超过限制,则字符串将被截断, 并且无效字符将被替换为 ’ ‘,然后返回重新构建的字符串值。

public static string CreateSafeSheetName(string nameProposal)

参数

nameProposal string

要使用的工作表名称

返回

string

CreateSafeSheetName(string, char)

检查给定的工作表名称,并在需要时创建一个有效的名称。 如果给定的工作表名称符合 Excel 工作表名称的规则,则返回该名称。 否则,如果长度超过限制,则字符串将被截断, 并且无效字符将被替换为给定字符,然后返回重新构建的字符串值。

public static string CreateSafeSheetName(string nameProposal, char replaceChar)

参数

nameProposal string

要使用的工作表名称

replaceChar char

将在给定工作表名称中替换无效字符的字符

返回

string

GetDateTimeFromDouble(double, bool)

将双精度值转换为日期时间值。

public static DateTime GetDateTimeFromDouble(double doubleValue, bool date1904)

参数

doubleValue double

双精度值。

date1904 bool

1904 年日期系统。

返回

DateTime

GetDoubleFromDateTime(DateTime, bool)

将日期时间转换为双精度值。

public static double GetDoubleFromDateTime(DateTime dateTime, bool date1904)

参数

dateTime DateTime

日期时间。

date1904 bool

1904 年日期系统。

返回

double

GetTextWidth(string, Font, double)

获取文本的宽度,以点为单位。

public static double GetTextWidth(string text, Font font, double scaling)

参数

text string

文本。

font Font

文本的字体。

scaling double

文本的缩放。

返回

double

GetUsedColors(Workbook)

获取工作簿中所有使用的颜色。

public static Color[] GetUsedColors(Workbook workbook)

参数

workbook Workbook

工作簿对象。

返回

Color[]

使用的颜色。

GetVersion()

获取发布版本。

public static string GetVersion()

返回

string

发布版本。

InitForDotNetCore()

为 .NetCore 程序进行初始化。 我们建议您首先调用此方法进行所有 .NetCore 初始化。 例如: CellsHelper.InitForDotNetCore(); Workbook wb = new Workbook();

public static void InitForDotNetCore()

MergeFiles(string[], string, string)

将一些大型 xls 文件合并为一个 xls 文件。

public static void MergeFiles(string[] files, string cachedFile, string destFile)

参数

files string[]

文件。

cachedFile string

缓存文件。

destFile string

目标文件。

备注

此方法仅支持将数据、样式和公式合并到新文件中。 缓存文件用于存储一些临时数据。

NeedQuoteInFormula(string)

指示工作表名称是否应用单引号括起来

public static bool NeedQuoteInFormula(string sheetName)

参数

sheetName string

工作表名称

返回

bool

RowIndexToName(int)

根据行索引获取行名称。

public static string RowIndexToName(int row)

参数

row int

行索引。

返回

string

行名称。

RowNameToIndex(string)

根据行名称获取行索引。

public static int RowNameToIndex(string rowName)

参数

rowName string

行名称。

返回

int

行索引。

 中文