https://bz.apache.org/bugzilla/show_bug.cgi?id=62328
Bug ID: 62328
Summary: Add support for blind cloning elements from XSSF that
are not directly supported
Product: POI
Version: 3.16-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
The use case I've come across is the following: we have a template xlsx file
that contains several Sheets. Most of them contain only two rows - the header
and a first row of dummy values that gives the format and/or style to be used
throughout the rest of the sheet. This is so because the template is create by
hand by our business users. Some other Sheets contain formulae calculated based
off the data that we generate into the first group of sheets. There are also
sheets with graphs that plot the aggregated data in some way.
When we begin generating real data into the workbook, we start by removing the
first rows in every sheet we feed with data (the dummy values row) and put real
data instead. This works with the traditional api, but not with streaming
because the streaming API cannot rewrite rows that are already written to disk.
So a solution/workaround/hack to circumvent this limitation was to copy the
template that we open into a newly created SXSSFWorkbook cell by cell. And this
pretty much works except some minor (irrelevant) styling differences and most
importantly - the graphs.
The support for graphs is very limited in the streaming api for obvious
reasons, but would it be possible to add a functionality, whereby the streaming
api would be able to simply clone (without exposing the possibility to
manipulate) elements of a worksheet that it doesn't understand? I've done it
for cells that contain formulae - formulae evaluation is not directly supported
in the API, but marking the workbook as requiring formula reevaluation at
opening time does the trick. We just store the formulae in the target
workbook's cells corresponding to the template and we're done.
Alternatively, If opening a template using the streaming api would allow
modifying as many rows as configured for random access, regardless of whether
they've been written to disk or not, would also do the trick in a much simpler
fashion for us, as we wouldn't need to copy the workbook template cell by cell,
but would just do the same thing as we've been doing in the non-streaming api -
just rewrite the dummy data.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]