Bug 56132

Summary: [PATCH] support ignore missing workbook references in XSSF
Product: POI Reporter: Andre Gebers <andre.gebers>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: add support to ignore missing workbooks on formula evaluation

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