Bug 61912 - about addMergedRegion issue
Summary: about addMergedRegion issue
Status: VERIFIED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.16-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-15 15:32 UTC by MJ
Modified: 2017-12-16 03:50 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MJ 2017-12-15 15:32:55 UTC
In version 3.13, the following code works even if(row1==row2).
sheet.addMergedRegion(new CellRangeAddress(row1, row2, 0, 0));

But in 3.16, the above code doesn't work if row1==row2. and it raises the Exception  java.lang.IllegalArgumentException message("
Merged region A11 must contain 2 or more cells."). 
So does the new version add this restriction?
Comment 1 Javen O'Neal 2017-12-15 18:34:06 UTC
When row1 == row2 == 10 and start column and stop column are both 0, then the merged region contains just one cell, A11. This is not allowed in Excel.

This rule is now enforced in POI to prevent creating a corrupt workbook.
Comment 2 MJ 2017-12-16 03:50:54 UTC
Got it, Thanks.