You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Jay <di...@gmail.com> on 2008/04/11 10:27:00 UTC

HSSF - Event API - 'Records should handle ContinueRecord internally' Exception

Hi,

I am just learning to use POI. my very first attempt to read an excel file
using Event API went wrong with following exception...

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:195)
at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:102)
at
com.digvijay.applications.siff.ExcelSpecialFormatter.execute(ExcelSpecialFormatter.java:45)
at
com.digvijay.applications.siff.ExcelSpecialFormatter.main(ExcelSpecialFormatter.java:25)

Can anyone guide me to resolve this exception. I searched everywhere but
could not get much help.

Thanks,
Jay

Re: HSSF - Event API - 'Records should handle ContinueRecord internally' Exception

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 15 Apr 2008, Jay wrote:
> But, I did spend some time that day, looking at the root cause of this 
> exception. Is it possible for you to reply me with why this error was 
> there ? just interested to know a bit more about it.

An excel file is made up of records. In some cases, the data to fit in a 
record is larger than it'd like, so it decides to write out the data over 
multiple records. First you get the main record, then you get continue 
record(s). Finally, you get the next record.

However, just for fun, sometimes excel does something different. Instead, 
it writes out a record, then the next record, and only then the continue 
record for the first record. So, we hit a continue record without 
expecting one, since the record it continues has already gone, and hence 
get the exception.

The usermodel recordfactory had workarounds for these odd cases of the 
continue record not directly following the main record, but eventusermodel 
didn't. The fix was to include the workaround in eventusermodel too

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: HSSF - Event API - 'Records should handle ContinueRecord internally' Exception

Posted by Jay <di...@gmail.com>.
Hi Nick,

Thanks. It in-fact was a problem with 3.0.1. Thanks for this wake up callm,
I was too tired that day to think about versions. :)
I've replaced it with 3.0.2 and it worked perfectly... same excel and no
issues so far..

But, I did spend some time that day, looking at the root cause of this
exception. Is it possible for you to reply me with why this error was there
? just interested to know a bit more about it.

Thanks again.

..Jay

On 4/11/08, Nick Burch <ni...@torchbox.com> wrote:
>
> On Fri, 11 Apr 2008, Jay wrote:
> > I am just learning to use POI. my very first attempt to read an excel
> file
> > using Event API went wrong with following exception...
> >
> > org.apache.poi.hssf.record.RecordFormatException: Records should handle
> > ContinueRecord internally. Should not see this exception
>
> What version are you using? I thought we'd fixed most of these for 3.0.2,
> but certainly they should be fixed in trunk. Can you try again with 3.0.2
> and a checkout from trunk, and see if it's fixed?
>
> If not, please upload the problem file to a new bugzilla bug, and we'll
> take a look
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: HSSF - Event API - 'Records should handle ContinueRecord internally' Exception

Posted by Nick Burch <ni...@torchbox.com>.
On Fri, 11 Apr 2008, Jay wrote:
> I am just learning to use POI. my very first attempt to read an excel file
> using Event API went wrong with following exception...
>
> org.apache.poi.hssf.record.RecordFormatException: Records should handle
> ContinueRecord internally. Should not see this exception

What version are you using? I thought we'd fixed most of these for 3.0.2,
but certainly they should be fixed in trunk. Can you try again with 3.0.2
and a checkout from trunk, and see if it's fixed?

If not, please upload the problem file to a new bugzilla bug, and we'll
take a look

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org