You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our use case of reading Excel files requires that errors in resolving the external sheet references in formula evaluations be ignored. This requires calling the org.apache.poi.ss.usermodel.FormulaEvaluator.setIgnoreMissingWorkbooks(boolean). This isn't currently possible with the current PoiSheet implementation - PoiSheet is package-private so it can't be extended to override the getRow method, which allows us to customize the FormulaEvalutor instance used.
What is the feasibility of doing one of these things?
Opening up PoiSheet for extension
Have a settings class which can be passed by the user and later applied by the PoiSheet to the FormulaEvaluator. This might result in future asks for setting classes for other things.
If nothing above works, the other option is to duplicate PoiSheet with necessary changes and then override PoiItemReader.
The text was updated successfully, but these errors were encountered:
While working on this I wonder if it would be a sensible default to set this to true by default. Or maybe even take it a step further and when we encounter a formula cell to always return the cached value. As we are reading the files the cached value should, generally speaking, be the right value. We don't inline change related cells or workbooks.
So from a performance perspective it might be even beneficial to, by default, ignore the formula(s).
Prior to this commit it was impossible to modify or configure the DataFormatter and FormulaEvaluator in use. With this commit we resolve this by introducing two interfaces. 1 DataFormatterCustomizer to customize/configure the the DataFormatter in use. 1 interface the FormulaEvaluatorFactory which is a factory used to create the FormulaEvaluator.
The default DataFormatterCustomizer will configure the formatter to use the cached values from cells instead of evaluating the formulas.
The default FormulaEvaluatorFactory in use will always return null instead of creating a FormulaEvaluator.
Fixes: #126
Our use case of reading Excel files requires that errors in resolving the external sheet references in formula evaluations be ignored. This requires calling the
org.apache.poi.ss.usermodel.FormulaEvaluator.setIgnoreMissingWorkbooks(boolean)
. This isn't currently possible with the current PoiSheet implementation -PoiSheet
is package-private so it can't be extended to override thegetRow
method, which allows us to customize theFormulaEvalutor
instance used.What is the feasibility of doing one of these things?
PoiSheet
for extensionFormulaEvaluator
. This might result in future asks for setting classes for other things.If nothing above works, the other option is to duplicate
PoiSheet
with necessary changes and then overridePoiItemReader
.The text was updated successfully, but these errors were encountered: