On Sun, 8 Jan 2012, ajaygarga wrote:
Using POI HSSF Event model APIs for XLS format, I tried with
AbortableHSSFListener so that I can abort the processing as soon as I am
done with a row.

You could just use MissingRecordAwareHSSFListener, and throw an exception when you want to abort, I believe that'll work

When I try to write my own Abortable MissinfRecordAware Listener similar to MissingRecordAwareHSSFListener, I found that it can emit LastCellOfRowDummyRecord to notify the End of Row, only after reading the cell of the next row or the beginning of the next sheet or the EOFRecord. If I want to pause the processing until the caller request for the next record, I will have to push back the last read record back into the stream which I am not aware of any lowel level POI APIs for the same.

That's correct - the excel format doesn't have an "end of row" marker, you just have to deduce it from the next record and spot it has moved rows. You don't need to "push back" directly though, just have a pre-read record cached on your side, and return that if present. I'm pretty sure we do something like that in a few places in POI

Please let me know if any of you know to use POI 3.5

As an aside, I'd suggest you try 3.8 beta 5 - there have been lots of fixes since 3.5

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to