Reputation: 1
So as I am using apache poi and the groupRow method to group data when creating an excel sheet, I am always hitting a limit of 99 rows when grouping.
My peers don't seem to know anything about this and I have also searched online and found nothing about this method having a limit. When you just open any excel file you can group more than 100 rows, however when I am creating a sheet by java, grouping only works up to 99 rows.
I might be missing something so I will put up the portion of code.
Thank you in advance!
for (int i = 0; i < resultList.size(); i++){
row = sheet.createRow(i + 11);
cell = row.createCell(0);
//*..... go on to make cells then I start grouping*
int currentRow = i+11;
int startRow = 0;
int endRow = 0;
for(int j = 0; j < mapList.size(); j++) {
int checkRow = 11+Integer.parseInt(mapList.get(j).get("count").toString());
if(currentRow == checkRow) {
endRow = 11+Integer.parseInt(mapList.get(j).get("count").toString())-2;
startRow = endRow - //*previous group's row +2 here*;
sheet.groupRow(startRow, endRow); // the grouping method
break;
}
}
}
Upvotes: 0
Views: 782
Reputation: 1
For everyone having the same problem. Check if you do not use SXSSFWorbook() - By default it has 100 rows buffer limit.
Look here: Apache Poi RowIterator only returning the last 100 (0 - 99) rows
Upvotes: 0