Bug 45472

Summary: Default row height problem with 3.1, OpenOffice 2.3
Product: POI Reporter: Ville Skyttä <ville.skytta>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Ville Skyttä 2008-07-23 13:21:47 UTC
Something that changed between POI 3.0.2 and 3.1 appears to have introduced a row height problem.

All the lines created without setting the row height appear with zero height when the resulting .xls file is opened with OpenOffice 2.3 (Linux).  A workaround is to explicitly set the row height to -1 for every row after creating them.  Setting default row height to -1 in the containing sheet has no effect.

OpenOffice 2.4 (Linux) does not appear to have this problem, so this could be an OpenOffice 2.3 bug.  I don't know what other software if any might be affected, but it would be nice to get this fixed for compatibility reasons.  As said, the problem does not exist in .xls files created with POI 3.0.2, only 3.1.

There's nothing special about the way the .xls are created, just basic stuff like:

        HSSFWorkbook book = new HSSFWorkbook();
        HSSFSheet sheet = book.createSheet();
        HSSFRow row = sheet.createRow(0);
        //row.setHeight((short) -1); // this would work around the problem
        HSSFCell cell = row.createCell((short) 0);
        cell.setCellValue(new HSSFRichTextString("Foo"));
        book.write(...);
Comment 1 Yegor Kozlov 2008-08-05 01:17:56 UTC
Fixed in r682620. 

In 3.1 the creation of new rows was refactored and some defaults were changed. 
According to the XLS spec, if the row height contains the 0x8000 bit then the row is standard height. OpenOffice 2.3 and earlier don't seem to understand it. 

Yegor