使用Node.js通过C++隐藏工作表中的零值显示
Contents
[
Hide
]
有时,您需要在电子表格中隐藏零值。这可能是个人偏好或格式化标准。
要在Microsoft Excel中隐藏工作表中的零值(例如Microsoft Excel 2003):
- 从工具菜单中选择选项,然后选择视图选项卡。
- 取消选中零值选项。
- 点击确定。
请参见以下示例代码,演示如何使用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"));