I am populating a template Excel sheet, with the data from the database :
for (Map<String, Object> 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 < 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 ?
Aim to Achieve :
- I want that the Un-Used rows following the populated rows should be hidden ?
- All Populated rows must be visible.
- Eg: If 1st 100 data rows are filled, then rows following 101 and onward should be hidden.
Please, help !!