【发布时间】:2011-08-03 18:48:51
【问题描述】:
我正在使用数据库中的数据填充模板 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 ?
目标实现:
- 我希望隐藏填充行之后的 Un-Used 行?
- 所有填充的行都必须可见。
- 例如:如果第 100 个数据行已填充,则应隐藏第 101 行及以后的行。
请帮忙!!
【问题讨论】:
标签: java excel apache-poi rows