Bug 19381

Summary: When MergeCellsRecord becomes too big, excel is unable to read the spreadsheet.
Product: POI Reporter: Willem MOORS <willem>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: minor    
Priority: P3    
Version: 1.5   
Target Milestone: ---   
Hardware: Other   
OS: Linux   

Description Willem MOORS 2003-04-28 08:04:52 UTC
I ran into a minor problem in POI, at first I thought it to
be related to the size of the data in the spreadsheet, but it turned
out to be the MergeCellsRecord that becomes too big, resulting 
in excel refusing to open the spreadsheet ("Unable to read file"),
while Gnumeric accepts it to be opened, but when trying to save it, 
gnumeric throws this assertion: ** CRITICAL **: file
/tmp/buildd/gnumeric-1.0.8/build/../plugins/excel/ms-biff.c: line 192
(ms_biff_put_len_next): assertion `len < MAX_LIKED_BIFF_LEN' failed.

This MAX_LIKE_BIFF_LEN turns out to be 8192.

Running your biffview on the spreadsheet, and piping that through a
grep/perl oneliner to sort the record-identifiers by size gives this : 

aa4028@gray : grep size|  biffview_01.txt | perl -pne 's/(.*=)(.*)/\2
\1\2/' | sort -n | tail -7
63 recordid = 0x41e, size =63
112 recordid = 0x5c, size =112
1018 recordid = 0xff, size =1018
7697 recordid = 0x3c, size =7697
8222 recordid = 0x3c, size =8222
8224 recordid = 0xfc, size =8224
12330 recordid = 0xe5, size =12330
^^^^^ => THE OFFENDER !!! too big (my guess)

When I remove all merging of cells from the code, and then generate the 
same spreadsheet again, Excel has no problems with the sheet anymore. 

aa4028@gray : grep size|  biffview_02.txt | perl -pne 's/(.*=)(.*)/\2
\1\2/' | sort -n | tail -7
58 recordid = 0xe5, size =58
63 recordid = 0x41e, size =63
112 recordid = 0x5c, size =112
1018 recordid = 0xff, size =1018
7697 recordid = 0x3c, size =7697
8222 recordid = 0x3c, size =8222
8224 recordid = 0xfc, size =8224
==> NO RECORDS GREATER THEN 8224 ( not 8192? ) --> works fine.

I thought I'd just inform you of this problem. I guess I'll just
rework my code to use fewer merged cells !

Thanks for your work on POI !
Comment 1 Andy Oliver 2003-07-24 16:24:29 UTC

*** This bug has been marked as a duplicate of 16362 ***