隐藏工作表中零值的显示

Contents
[ ]

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

  1. 来自工具菜单,选择选项 , 然后选择看法标签。
  2. 取消选择零值选项。
  3. 点击好的.

请参阅以下演示使用 Aspose.Cells 隐藏零的示例代码。

// 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 a new Workbook object
Workbook workbook = new Workbook(dataDir + "book1.xlsx");
// Get First worksheet of the workbook
Worksheet sheet = workbook.Worksheets[0];
// Hide the zero values in the sheet
sheet.DisplayZeros = false;
// Save the workbook
workbook.Save(dataDir + "outputfile.out.xlsx");