On Tue, 12 Mar 2013, frankgrimes97 wrote:
For these reasons, I would like to offer users an option to retrieve the
data in Excel format directly.
The amount of data retrieved can be quite large, but from my understanding
it should be possible to create/stream XLSX/OOXML directly to a
ServletOutputStream.
However, I've looked at the documentation and API for SXSSF in POI and I
don't see a way to avoid writing the content out to a temporary file.
Is it possible to generate the content without incurring the cost of disk
write/read I/O and then cleanup?
Nope, sorry. The excel file format has some back-and-forward references.
The .xlsx format doesn't have as many as .xls, but there are still some.
In theory, you should be able to open a streaming zip write, push out the
bits that don't have back/forward refs, write some bits of the file, send
those, then send the last parts and wrap it all up. It would mean some
noticable changes to low level bits of POI though, as some bits (esp the
ooxml code) assumes everything is to hand
If you're worried about disk io, you'd be best off just using something
like tmpfs or a ram disk to hold the parts.
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]