Render hidden columns and rows

This article explains how to show hidden rows and cells when viewing Spreadsheets with GroupDocs.Viewer within your Java applications.

Background

Sometimes Excel document may contain hidden columns and rows (as shown in the image below). GroupDocs.Viewer doesn’t render hidden columns and rows by default. However, there may be the case when you want to control the inclusion of hidden content in the rendering results. 

The Solution

GroupDocs.Viewer provides setRenderHiddenRows(…) and setRenderHiddenColumns(…) options in SpreadsheetOptions class which enables rendering hidden rows and columns as shown in the following code samples. 

    Viewer viewer = new Viewer("sample.xlsx");
    HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    viewOptions.getSpreadsheetOptions().setRenderHiddenColumns(true);
    viewOptions.getSpreadsheetOptions().setRenderHiddenRows(true);
    viewer.view(viewOptions);
    viewer.close();

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.