使用Node.js通过C++隐藏工作表中的零值显示

Contents
[ ]

要在Microsoft Excel中隐藏工作表中的零值(例如Microsoft Excel 2003):

  1. 工具菜单中选择选项,然后选择视图选项卡。
  2. 取消选中零值选项。
  3. 点击确定

请参见以下示例代码,演示如何使用Aspose.Cells for Node.js via C++隐藏零值。

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "book1.xlsx");
// Create a new Workbook object
const workbook = new AsposeCells.Workbook(filePath);

// Get First worksheet of the workbook
const sheet = workbook.getWorksheets().get(0);

// Hide the zero values in the sheet
sheet.setDisplayZeros(false);

// Save the workbook
workbook.save(path.join(dataDir, "outputfile.out.xlsx"));