Summary: | Support for IgnoredErrors in XSSF | ||
---|---|---|---|
Product: | POI | Reporter: | peterhansson_se |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | CC: | emercoyle |
Priority: | P2 | ||
Version: | 3.14-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Bug Depends on: | 56892 | ||
Bug Blocks: | |||
Attachments: | Proposal for usermodel implementation |
Description
peterhansson_se
2015-11-23 21:46:24 UTC
*** Bug 54868 has been marked as a duplicate of this bug. *** There's low level record support for this for HSSF, see #46136 If we can't read it back, then it's rather tricky to unit test it if nothing else! Bug #56892 has one proposed usermodel implementation for this, but it really needs a bit more work and to be made more generic. Being able to roughly mirror behaviour for adding/setting and reading would be a bonus too Any thoughts on the right usermodel interface for adding this? It is kinda similar in concept to DataValidations. I think the usermodel for that can be re-used as inspiration. For information: In OOXML there are quite a few types of IgnoredErrors: - evalError - twoDigitTextYear - numberStoredAsText - formula - formulaRange - unlockedFormula - emptyCellReference - listDataValidation - calculatedColumn This is just to say that 'numberStoredAsText' is just one of many. I notice that the XSSF implementation for DataValidation has some utility code for dealing with 'sqref'. This type of code should be moved out of DataValidation and into a utils class or something as the same needs to be used for IgnoredErrors. Created attachment 33311 [details]
Proposal for usermodel implementation
I've attached a proposal for a complete usermodel implementation. The proposal is inspired by DataValidation. The proposal adds an interface named IgnoredError and corresponding new methods in Sheet: setters: addIgnoredError(IgnoredError) removeIgnoredError(IgnoredError) getters: List<? extends IgnoredError> getIgnoredErrors(); I've kept it simple. It is perfectly possible to have overlap in ignore error. Suppose I add For types twoDigitTextYear,numberStoredAsText ignore in cells A1:A5. and then in addition I add For type numberStoredAsText ignore in cell A1. Now this is obviously redundant wrt to A1: I've told twice that I want 'numberStoredAsText' to be ignored for that cell. I've decided that this is perfectly acceptable for the simple reason that it is also acceptable in OOXML. This means implementers of the above shouldn't try to be clever about it and try to collapse/reduce what has been requested *unless this is specifically required by the format*. - formula - formulaRange - unlockedFormula - emptyCellReference There has been some work on this via Bug 56892, can you take a look and see how much of your proposed changes are still missing? there was no update here in quite some time, therefore I am setting this to WONTFIX for now. We have support for ignoring errors for regions for XSSF via bug 56892, support for HSSF is discussed in bug 46136. If you would like to propose more changes then please reopen this bug with an updated patch that applies to the current trunk. |