Summary: | allow appending to large workbooks without reading | ||
---|---|---|---|
Product: | POI | Reporter: | geoff.groos |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | NEEDINFO --- | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 3.10-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
geoff.groos
2015-05-01 17:39:43 UTC
If you just want to add sheets, then as long as those sheets have no external references, it should be fairly easy. Open the destination OPCPackage, and read the workbook stream in via xmlbeans (it's small). Open the OPCPackage holding your sheets to add, create a part in the destination, then copy the contents over of the sheet part. Add the relation for the new sheet, and use xmlbeans to add a reference to the new sheet with that relation. Save! I'm not sure if this counts as in-scope for SXSSF or not, but I could certainly see value in writing it up as something for the examples directory for now at least. If you do get it working, please contribute it back as such! I've never worked with the OPCP package so I'm only understanding your suggestion vaguely, but I'll see what I can do and if I come up with something elegant I'll get it back to you guys. Right now the issue that would implement this feature on my side is blocked by another feature request I've got with JavaFX (https://javafx-jira.kenai.com/browse/RT-40703), so I'm not going to make any forward progress on this for some time. In the mean time you I'd be happy to turn this issue into a 'add documentation on how to do appending sheets to large workbooks' and leave it open until I get around to implementing it, or simply closing it as WONT-FIX. Any updates on the JavaFX bug or suggested documentation (or example code https://svn.apache.org/viewvc/poi/trunk/src/examples/) Keeping this on needinfo based on previous comment. A more general solution to the memory problem is to lazy load sheets and allow sheets to be swapped between disk and memory. I'm guessing this is how Microsoft Excel keeps its memory footprint from exploding on workbooks with thousands of sheets. |