数据表的数组公式计算

Contents
[ ]

在以下示例代码中,我们使用了source excel file。如果您将单元格B1的值更改为100,则填充为黄色的数据表的值将变为120,如下图所示。 示例代码生成了output PDF

todo:image_alt_text

todo:image_alt_text

以下是用于从source excel file生成output PDF的示例代码。 请阅读注释以获取更多信息。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create workbook from source excel file
Workbook workbook = new Workbook(dataDir + "DataTable.xlsx");
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// When you will put 100 in B1, then all Data Table values formatted as Yellow will become 120
worksheet.Cells["B1"].PutValue(100);
// Calculate formula, now it also calculates Data Table array formula
workbook.CalculateFormula();
// Save the workbook in pdf format
workbook.Save(dataDir + "output_out.pdf");