Bug 50319

Summary: Creating a group row for the first row and calling setRowGroupCollapsed causes IllegalArgumentException.
Product: POI Reporter: Uira <uira.apache>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major CC: uira.apache
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Uira 2010-11-22 17:03:26 UTC
Creating a group with just the first row, and then collapse the group causes an exception.

Sample Code:

sheet.groupRow(0, 0);
sheet.setRowGroupCollapsed(0, true);

Exception:

Caused by: java.lang.IllegalArgumentException: The row number must be between 0 and 65535
	at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.getRow(RowRecordsAggregate.java:149)
	at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.findStartOfRowOutlineGroup(RowRecordsAggregate.java:301)
	at org.apache.poi.hssf.record.aggregates.RowRecordsAggregate.collapseRow(RowRecordsAggregate.java:343)
	at org.apache.poi.hssf.usermodel.HSSFSheet.setRowGroupCollapsed(HSSFSheet.java:1701)
Comment 1 Dominik Stadler 2015-09-29 12:27:49 UTC
Fixed as of r1705844, it seems only the check for row >= 0 was missing, column-grouping seems to be fine in this regard already.