Peter Dow (DSS) wrote:
Hi Andy,
Btw, thanks for all the work you and the other people have done on this
project! It's a lot of fun using it.
Thanks!
My intent was to read (only) the ColumnInfoRecords and save the
HSSFCellStyle objects for each column when I initially open the worksheet.
Later I'd use that information to apply the cell style to a newly created
HSSFCell object. I assumed I'd need the number of ColumnInfo records, but
it looks like with the eventmodel I just register a listener for the
ColumnInfo record only (recordsid = 0x7d, right?) and let the event factory
call me whenever it reads a ColumnInfo record in the stream.
So if you're MODIFYING a sheet you CANNOT use the event model at all.
If you're just reading a sheet for some styles to apply then you can't
just use the objects (they're reference objects to things in the actual
sheet, you can't just apply them in a new sheet). You'd need to create
styles. You can get and set the column width, for example, using the
HSSFSheet.
It looks like we have not exposed the default column style (I for some
reason hallucinate that I coded this some time ago) through the user
model. That should be corrected.
You are correct that RPG has no concept of objects, but I am able to perform
methods in Java classes and receive values from them; what I'm not certain
of is registering a listener. You're probably right in saying that I'll
have to have some Java wrapper that acts as the listener and somehow gets
the data back to my RPG program
Can the JAva code call an RPG method?
.
This has me curious though -- how does Excel do this? When an empty
worksheet has column formatting applied to it, and I put a value in a cell
in one of those columns, the formatting is applied. Is Excel doing
something similar do you suppose? It would be nice if the createCell method
did this for me.
There is "default column style", "default row style" and "cell style".
When you apply a style to HSSFCell it is the latter. Curious that no
one ever added a way to manipulate the former two. If someone wants an
easy task in order to get involved this is a good one. Otherwise I'll
get around to it shortly.
-Andy
Peter Dow
Dow Software Services, Inc.
www.dowsoftware.com
909 793-9050 voice
909 793-4480 fax
-----Original Message-----
From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]
You can't get the ColumnInfoRecordsAggregate. You get the
ColumnInfoRecord. However you shouldn't be programming at this level
generally for non-read only uses. Meaning just use "usermodel" for all
of your read/write apps and only use the event stuff for read only and
don't worry about the record, eventmodel, etc packages (stay usermodel).
I have no knowledge of RPG (came from C and assembler), however its just
a callback w/interface. Not sure how you call to RPG from Java or vice
versa, and I imagine RPG has no concept of "objects" and "interfaces" so
I'd imagine you'd create a small wrapper in Java that called your RPG
program passing the value back.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/52 - Release Date: 7/19/2005
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
.
--
Andrew C. Oliver
SuperLink Software, Inc.
Java to Excel using POI
http://www.superlinksoftware.com/services/poi
Commercial support including features added/implemented, bugs fixed.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/