Yug*_*dle 4 java excel rows apache-poi
我正在使用数据库中的数据填充模板Excel工作表:
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 ?
Run Code Online (Sandbox Code Playgroud)
旨在实现:
- 我想要隐藏填充行后面的未使用行吗?
- 所有填充行必须可见.
- 例如:如果填充了第1 100个数据行,则应隐藏101之后的行.
请帮忙 !!
小智 5
Row r = sheet.getRow(indexRow);
if ( r!=null ) {
r.setZeroHeight(true);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8250 次 |
| 最近记录: |