Surowiec, William wrote:

I am using the HSSF event model to read assorted spreadsheets - very nice.

I am now looking for an approach, such that when the code is presented with
a record event, the code is able to access cell type information.


Some specific questions:

1) While the EventModel is generating events, is it also building the
UserModel?


Absolutely not. Thats why its so efficient.

2) When the EventModel is notifying me about a NumberRecord, does the
UserModel have the information
on the same underlying cell to give me an HSSFCell object? Or how can I
transform a record to an HSSFCell? Or given the underlying information, can I ask the UserModel (I know it does
not exist in the same way
I am using it in this document) to give me the HSSFCell at that location?


You'll need to catch the ExtendedFormat, Font and Format records (for instance). The NumberRecord (and LabelSST, etc) will have a reference number for these.

3) Given that I am trying to get format and style information for the cell -
is there another way?


answered above.

I've spent several hours crawling the archives and docs and code and sense
this may be easy or hard
and have not a clue which.


The advantage of the Event User Model is that it DOESN'T build a usermodel, it just identifies the structures and passes them on. The disadvantage is that it requires intimate knowledge of the file format. The easiest way to grasp this is to read the javadoc of the org.apache.poi.hssf.record and ask questions. You can also read the Open Office Excel spec (linked from our site) and perhaps grab a copy of the Excel 97 Developers' Kit (out of print but available from amazon).

Probably the latter two would be excessive for your needs. We'd appreciate any documentation contributions that you can make regarding the use of the event user model. its not the best documented part of POI admittedly. Perhaps even on the wiki: http://nagoya.apache.org/wiki/apachewiki.cgi?POIProjectPages

-Andy

Thank you in advance,

Bill







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to