On Wed, 20 Mar 2013, Richard Gathogo wrote:
I have a web application where some users can export their data to an excel
document. I would like export the data directly to the output stream so
that the download starts immediately the export starts instead of first of
creating a workbook then writing the work book to my output stream. Is
there anyone with an idea on how I can achieve this?

The excel file format has back-and-forth references, so it's not something that can be streamed during writing. (.xlsx is slightly better, and some parts can be written in a streaming way by SXSSF, but not the whole thing). You'll need to build the workbook up in memory, then have it write out to your servlet output stream. You might need to open it first though in chunked mode, and send some empty frames, to stop the browser getting bored and deciding the download has failed. Pretty sure there's some examples in the list archives

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to