You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Daniel Noll <da...@nuix.com> on 2006/11/23 23:38:58 UTC

RecordFormatException: Records should handle ContinueRecord internally.

Hi all.

Just for background, I'm trying to figure out how to extract binary
image data from an Excel workbook.  Ideally I'd be able to get at all
embedded binary data (e.g. OLE2 objects) but images are enough for now.

I thought I'd try the low-level approach. i.e.:

     POIFSFileSystem fs = (...load the filesystem...);

     HSSFRequest request = new HSSFRequest();
     request.addListenerForAllRecords(new HSSFListener() {
         public void processRecord(Record record) {
             System.out.println(record); // TODO: Find the record.
         }
     });

     HSSFEventFactory factory = new HSSFEventFactory();
     factory.processWorkbookEvents(request, fs);

It manages to get up to three [BOUNDSHEET] records but then I get an error:

"org.apache.poi.hssf.record.RecordFormatException: Records should handle
ContinueRecord internally. Should not see this exception
	at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:194)
	at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:101)
	at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processWorkbookEvents(HSSFEventFactory.java:66)"

This is on current trunk so I was wondering whether this is a bug, or 
whether I'm doing something wrong.

FWIW, I have since added code to HSSFWorkbook to directly get the images 
out, without having to use this method.  But we still use the above 
method to extract comment text from the workbook so it needs to work.

Daniel


-- 
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/