You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Paul Davidson <PD...@Emery-Waterhouse.com> on 2003/01/20 17:12:22 UTC

Adding merged cells

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);

Thanks,
Paul

Re: Adding merged cells

Posted by "Andrew C. Oliver" <ac...@apache.org>.
I think this is a known bug that hasn't been fixed because no one 
entered it into bugzilla.  Basically the underlying binary record can be 
"continued" however we don't currently implement continues.  So its 
limited to the maximum size for the binary records (IIRC 4k or so)..  

-Andy

Paul Davidson wrote:

>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);
>
>Thanks,
>Paul
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>