Bug 56132 - [PATCH] support ignore missing workbook references in XSSF
Summary: [PATCH] support ignore missing workbook references in XSSF
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 05:44 UTC by Andre Gebers
Modified: 2014-07-30 18:09 UTC (History)
0 users



Attachments
add support to ignore missing workbooks on formula evaluation (7.85 KB, application/x-gzip)
2014-02-13 05:44 UTC, Andre Gebers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Gebers 2014-02-13 05:44:51 UTC
Created attachment 31306 [details]
add support to ignore missing workbooks on formula evaluation

Currently formula evaluation with external references throw a RuntimeException (not implemented yet XSSFEvaluationWorkbook:128) but I'd like POI to use the cached value in this case. HSSFFormulaEvaluator already provides setIgnoreMissingWorkbooks(boolean ignore). The attached patch adds this functionality to the XSSFFormulaEvaluator.
Comment 1 Nick Burch 2014-02-13 12:29:18 UTC
I'd much rather someone implemented the external references support in XSSF, rather than just hiding the problem!
Comment 2 Tim Dettrick 2014-02-14 01:06:21 UTC
Andre and I would ideally like to implement external references support too, as we're currently doing this at the application level in an incomplete way. If we do, then we'll certainly submit another patch.

For now, this patch replicates the HSSF functionality to ignore external references, which is simpler than ForkedEvaluator for developers who are happy to ignore external references but still want to evaluate local cells.

The previous behaviour is a runtime exception of "not implemented yet" with no easy workaround, so this is an improvement.
Comment 3 Nick Burch 2014-07-24 17:02:35 UTC
There is now some XSSF Formula support for external references in trunk

Any chance you could review that, then either make some changes to your patch if needed, or comment that no further changes are needed if the patch is fine as-is?
Comment 4 Nick Burch 2014-07-30 18:09:49 UTC
As of r1614729, FormulaEvaluator now has the setIgnoreMissingWorkbooks method, and XSSF uses it. Unit tests added based on the existing HSSF case, by switching in a different base workbook to evaluate against