Well, this has not worked as seamless as I expected.  It seems that for
whatever reason, the wkBook.write(outStream) only writes the first set
of rows, and then does not write anything else.  As mentioned below,
after writing the first set of rows, I try to delete them from the
working memory, adjust my rowStartCtr, then repeat the process; however,
this is failing miserably.  I have also removed the logic to remove the
rows, and it has no affect, which leads me to believe that the
wkBook.write(outStream) has issues when writing multiple times.  

I have the code base, and I am trying to look through the code, but I
have not had any revelations just yet.  

Has anyone had any problems writing data to the stream multiple times
via the write() method? 

Thanks, 
   Sean  

-----Original Message-----
From: Sean Conlon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2008 8:49 AM
To: POI Users List
Subject: RE: Stream Output

Yes, I am dealing with large spreadsheets of data.  (Working with a
legacy system that only handles data in a spreadsheet, don't ask)  

I think I have found the solution: I create the spreadsheet, add rows
accordingly (100 at a time is what I desire to process), then write them
to the outputstream.  Then, after the stream has completed, I obtain an
iterator over all of the rows, then iterate over them and call
"hssfSpreadsheet.removeRow(hssfRow)".  

I will just have to maintain a counter so I start my next 100 rows at
the right place for the next time I repeat this process.  Throughout
this process, I will use the same hssfSheet.  

Does anyone see a performance problem with this solution?  

Thanks, 
    Sean  



-----Original Message-----
From: Knudsen, Joe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2008 8:31 AM
To: POI Users List
Subject: RE: Stream Output

Sean,
Are you working with large spreadsheets is that the problem?  I am
guessing you are aware you could stream to memory but if that is not an
option due to size?  Just curious where the performance issue exists.

Thanks,
Joe

-----Original Message-----
From: Sean Conlon [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 21, 2008 5:39 PM
To: [email protected]
Subject: Stream Output

Is there a way that I can stream the output to a file (e.g. wkbook.xls)?

 

 

As far as I understand it, when I call "wkBook.write(outStream);", it
flushes everything within the wkBook (HSSFWorkbook) to the stream (aka
file).  However, that is extremely unscalable.  Is there a way that I
can write to a HSSFWorkbook a chunk at a time?

 

Any help would be appreciated. 

 

Thanks, 

    Sean  

 

 

 

Sean Conlon     

Credera

http://www.credera.com <http://www.credera.com/> 

Direct: 972.692.0010

Mobile: 254.644.3587

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>       

The Power of Perspective

 


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


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


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

Reply via email to