隐藏工作表中零值的显示
Contents
[
Hide
]
有时,您需要在电子表格中隐藏零值。这可能是个人喜好或格式标准。
要在 Microsoft Excel(例如 Microsoft Excel 2003)的工作表中隐藏零值:
-
来自工具菜单,选择选项 , 然后选择看法标签。
-
取消选择零值选项。
-
点击好的.
在 Microsoft Excel 中隐藏零值
请参阅以下示例代码,演示如何使用 Aspose.Cells 隐藏零。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(HidingDisplayOfZeroValues.class); | |
// Create a new Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xlsx"); | |
// Get First worksheet of the workbook | |
Worksheet sheet = workbook.getWorksheets().get(0); | |
// Hide the zero values in the sheet | |
sheet.setDisplayZeros(false); | |
// Save the workbook | |
workbook.save(dataDir + "output.xls"); |