This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes streaming excel files on ServletOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "streaming excel files on ServletOutputStream" Watch "streaming excel files on ServletOutputStream" New topic

streaming excel files on ServletOutputStream

m Shalaby

Joined: Sep 09, 2009
Posts: 2

I want to export an excel file on ServletOutputStream for a very large size of data that may exceeds 100K rows. I'm using POI APIs. and I'm trying to write 1000 row per time and flush the stream and then append the rest of rows 1000 row per time. Is that possible?
I could not do it with ServletOutputStream, but I did it with FileOutputStream!!! What is the difference between both setreams.

BTW, my silution on FileOutputStream is taking alot of time to create the file.

Here is the code that create the file on FileOutputStream incrementally:


Have any one tryed to export large excel sheets (> 100K rows)???

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
I always thought XLS files were limited to 64K rows; has that limit been relaxed?

The code looks as if you're overwriting the file for each sheet, not appending; does the generated file actually have all the information? Note that XLS is a structured document format for which you can't use file appending in the sense; you'll need to work with the POI API.

} catch (Exception e) {

You should never do this if I/O is involved; how will you know about problems that occur? At least print a message to a log file.

I could not do it with ServletOutputStream

What does that mean?
manoj r patil
Ranch Hand

Joined: Jun 06, 2002
Posts: 181
I always thought XLS files were limited to 64K rows; has that limit been relaxed? Excel 2007, the limit is increased multifold to 1000k from 65k.

love your job and not your company;
...because you never know when your company will stop loving you!
I agree. Here's the link:
subject: streaming excel files on ServletOutputStream
It's not a secret anymore!