title: How to hide the following Un-used rows in Excel sheet using Java Apache POI?
body: <p>I am populating a template Excel sheet, with the data from the database :</p>
  
  <pre><code> for (Map&lt;String, Object&gt; resultRow : dbResults) {
          if ((currentRow = sheet.getRow(currentDataRow)) == null) {
              currentRow = sheet.createRow(currentDataRow);   // Creates a new row.
          }
          //currentRow.getRowStyle().setHidden(false);
  
          for (int i = 0; i &lt; resultColumns; i++) {
              currentCell = currentRow.getCell(i, Row.CREATE_NULL_AS_BLANK);
              setCellValue(currentCell, resultRow.get(dbcolumnNames[i]));
          }
          currentDataRow += 1;
      }
  
  // How to hide all empty/Un-used rows following currentDataRow ?
  </code></pre>
  
  <p><strong>Aim to Achieve :</strong></p>
  
  <blockquote>
    <ul>
    <li><strong>I want that the Un-Used rows following the populated rows should be hidden ?</strong></li>
    <li>All Populated rows must be visible.</li>
    <li>Eg: If 1st 100 data rows are filled, then rows following 101 and onward should be hidden.</li>
    </ul>
  </blockquote>
  
  <p><strong>Please, help !!</strong> </p>