>  What I'm trying to establish is how I would go about writing out a .....

Yeah, sorry, i think that WAS the point of your original mail, but it got lost in the 
conversation somehow... most of us take the architecture advice of web servers to 
heart.. be stateless to be scalable .. :)

But anyways... It is, in general, not possible to stream the writing of an excel file, 
since the file structure contains upstream pointers to downstream data. 

The changes in HEAD do not address this issue.. all that they do is optimise the 
memory usage of POI , ensuring that the same data is not stored twice etc. It should 
cause a 30-40% reduction in POI memory as well as time for large workbooks. 

The solution for streaming like access currently proposed is to user the 
RandomAccessFile. Chris has proposed such a solution.. but not many people have 
actually worked with that solution. 

HTH
-
Avik



   -------Original Message-------
   > From: Robert Lowe <[EMAIL PROTECTED]>
   > Subject: RE: RE: Event-based API for generating Excel files?
   > Sent: 28 Oct 2003 19:35:20
   >
   >  > but no, in particular, whats changed is the way in which records are
   >  stored/referenced. So look at the low level model classes, that build up the
   >  excel object model.. thats where the guts of it are. Then there are smaller
   >  changes in how the usermodel classes access the low level model. Most of the
   >  "business logic" , ie, interactions of records etc, are relatively
   >  unchanged.
   >  
   >  Thanks, Avik.
   >  
   >  What I'm trying to establish is how I would go about writing out a
   >  spreadsheet without having to build up the entire document model in memory
   >  first. I'm reading data from a JDBC ResultSet and want to be able to read a
   >  row from the ResultSet, generate the corresponding spreadsheet row, and send
   >  it to the client (it's a Web client) immediately without having to buffer a
   >  few tens of thousands of rows in memory on the server (since it'd kill the
   >  server pretty quickly...).
   >  
   >  I guess I was hoping that the Event API might help me here, but as far as I
   >  can see, there's no way to use the 'eventusermodel' classes for writing a
   >  document--I'd need to work directly with the low-level classes in the
   >  'record' package. Looking at the code, it looks like what I'd have to do
   >  (for each row) is:
   >  
   >  - create the appropriate Records for the Excel spreadsheet row;
   >  - create a byte array of the right size;
   >  - copy the Records into the byte array using the Record.serialize(int
   >  offset, byte[] data) method;
   >  - write the byte array to my OutputStream;
   >  - repeat for the next row & etc.
   >  
   >  The catch, I guess, is knowing which records to put in which order. Guess
   >  I'd need to get a copy of "Microsoft Excel 97 Developer's Kit" and 
brush up
   >  on the Excel file format.
   >  
   >  
   >  
   >  Best regards,
   >  
   >  Robert Lowe
   >  http://RMLowe.com/
   >  
   >  
   >  
   >  
   >  ---------------------------------------------------------------------
   >  To unsubscribe, e-mail: [EMAIL PROTECTED]
   >  For additional commands, e-mail: [EMAIL PROTECTED]
   -------Original Message-------


Reply via email to