公共 API Aspose.Cells 8.0.1 的变化

MemorySetting 属性添加到 Cells 类

Cells 类公开了 MemorySetting 属性,可用于优化单元格数据的内存使用,从而降低整体内存成本。以下示例显示如何在优化模式下将大数据写入工作表。

C#

 //Instantiate a new Workbook

Workbook book = new Workbook();

//Set the memory preferences

book.Settings.MemorySetting = MemorySetting.MemoryPreference;

//To change the memory setting of existing sheets, please change memory setting for them manually:

Cells cells = book.Worksheets[0].Cells;

cells.MemorySetting = MemorySetting.MemoryPreference;

//Input large dataset into the cells of the worksheet

//Your code goes here

内存设置不适用于 Workbook 对象自动创建的默认工作表。为了更改现有工作表的内存设置,请在执行任何数据操作之前手动应用内存设置。