Bug 28126

Summary: reading files generated by SpreadCE 1.18 causes Exception.
Product: POI Reporter: Julio Madrid <julmadrid>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Julio Madrid 2004-04-01 12:29:17 UTC
When I try to read excel files generated by SpreadCE 1.18 running under 
WindowsCE 2002 and WindowsCE 2003 I find two troubles:

1) org.apache.poi.hssf.record.agregate.ValueRecordsAgregate.construct(int,List) 
fail when org.apache.poi.hssf.record.LabelRecord are included in the agregate 
because the java.util.TreeMap need that the keys implement the Comparable 
interface and LabelRecord doesn't do.

2) If I try to resolve the previous trouble by implementing Comparable interface
in LabelRecord as it was implemented in other Record extended classes 
(LabelSSTRecord by example). When I do that,  
org.apache.poi.hssf.model.Sheet.convertLabelRecords(Workbook) can't replace 
LabelRecords included inside the ValueRecordsAgregate. This causes Exception in 
the org.apache.poi.hssf.usermodel.HSSFCell constructor because is unable to 
recognize the LabelRecord Type.

I resolve this by inserting code for convert from LabelRecord to LabelSSTRecord 
prior to Sheet generation in org.apache.poi.hssf.usermodel.HSSFWorkbook 
constructor instead of calling Sheet.convertLabelRecords() after Sheet 
generation.
Comment 1 Avik Sengupta 2004-04-01 16:10:21 UTC
looks similar to bug 19053. Could you (Julio) possibly attach a spreadseet? 

We seem to use LABLEL records read only, but doesnt seem to be a testcase for
this.. isnt this actually supported and tested.. any ideas? 

Perry (bug 19053) tells me that the errors go away if the sheet is changed in
any way and saved. Seems to fit, since new versions of the Excel do not write
LABEL records, AFAIK. 
Comment 2 Avik Sengupta 2004-04-02 12:05:20 UTC
Terry Pew has confirmed that the sheet attached to bug 19053 has been created on
a PDA. Marking this one as duplicate. 

Any ideas if changing Sheet.convertLabelRecords to be called prior to sheet
generation rather than after will cause any side effects? Thoughts?

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