Hiding the Display of Zero Values in the Worksheet

Contents
[ ]

To hide zero values in a worksheet in Microsoft Excel (for example Microsoft Excel 2003):

  1. From the Tools menu, select Options, and then select the View tab.

  2. Deselect the Zero values option.

  3. Click OK.

    Hiding zero values in Microsoft Excel

todo:image_alt_text

Please see the following sample code that demonstrates how to hide zeros using Aspose.Cells.

// 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");