Discussion:
Updating first row at end of creating xlsx using xssf
Jason Smith
2018-06-08 18:54:18 UTC
Permalink
I need to update the first row of a xlsx at the end of creating it, as it
is value is not know till the end.

Is there any good way to update the cell text content of the first row
after it has been flushed, besides writing to disk and then copying xlsx1
to xlsx2 row by row?


Thanks,

Jason
pj.fanning
2018-06-09 14:24:41 UTC
Permalink
If you are not worried about holding the full row set in memory, then
XSSFWorkbook will allow you to construct the full workbook and update the
first row before saving.

If you need to stream the data to avoid holding full row set in memory, then
you could do the streaming twice - once to produce the main output and then
to re-stream that intermediate output and to add the correct first row in
the final output. You might try a combination of
https://github.com/monitorjbl/excel-streaming-reader and SXSSFWorkbook for
writing the output.



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org

Loading...