Bug 50319 - Creating a group row for the first row and calling setRowGroupCollapsed causes IllegalArgumentException.
Summary: Creating a group row for the first row and calling setRowGroupCollapsed cause...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-FINAL
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 17:03 UTC by Uira
Modified: 2015-09-29 12:27 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.