Bug 16362

Summary: Can't open xls file if number of merged regions exceeds certain limit
Product: POI Reporter: Paul Davidson <pdavidson>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major CC: willem
Priority: P3    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Paul Davidson 2003-01-23 14:09:42 UTC
I'm trying to construct an xls file with plenty of merged cells, about 5 
separate groups of merged cells per row.  This works fine until the number of 
rows exceeds about 1000.  When I try to open the file in MS-Excel 2000, I get 
a message saying: " Unable to open file", and then refuses to open the file.  
Has anybody out there experienced anything similar, and possibly found a 
solution?

I'm using the latest release version of POI, in jakarta-poi-1.5.1-final-
20020615.jar.  To add the merged cells, I'm creating a new 
org.apache.poi.hssf.util.Region object and adding that to the HSSFSheet 
instance using the addMergedRegion method, eg

      Region region = new Region(rowNum, colFrom, rowNum, colTo);
      m_Sheet.addMergedRegion(region);


JDK version: j2sdk1.4.1_01
OS: Windows XP 5.1, build 2600.xpsp 1.020828-1920: service pack 1.
Comment 1 Andy Oliver 2003-07-24 14:13:35 UTC
I plan to fix this in 3.0
Comment 2 Andy Oliver 2003-07-24 16:24:30 UTC
*** Bug 19381 has been marked as a duplicate of this bug. ***
Comment 3 Josh Micich 2008-08-25 12:31:07 UTC
Re-tested OK in latest svn

This was probably fixed some time ago (pre version 3.0).  There is a junit which seems to test this exact functionality: TestSheet.testAddMergedRegion().  The junit was added in svn r353660 (May 2005).