Bug 61863 - Sheet.ForceFormulaRecalculation not overridden by Workbook.ForceFormulaRecalculation
Summary: Sheet.ForceFormulaRecalculation not overridden by Workbook.ForceFormulaRecalc...
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.17-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on: 61700
  Show dependency tree
Reported: 2017-12-06 11:40 UTC by Luca
Modified: 2020-03-28 09:50 UTC (History)
0 users

JUnit test class. (2.61 KB, text/plain)
2017-12-11 08:50 UTC, Luca
Excel empty file (8.63 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-12-11 14:25 UTC, Luca

Note You need to log in before you can comment on or make changes to this bug.
Description Luca 2017-12-06 11:40:59 UTC
If you create an excel file with automatic formula recalculation and get a workbook from it, workbook.getForceFormulaRecalculation() returns true while sheet.getForceFormulaRecalculation() returns false on every sheet, while it should return true as well.
Comment 1 Luca 2017-12-11 08:50:10 UTC
Created attachment 35600 [details]
JUnit test class.

Add JUnit test class.
Comment 2 Mark Murphy 2017-12-11 12:05:42 UTC
Can you provide test.xlsx as well? Your test cases do not work without it.
Comment 3 Luca 2017-12-11 14:25:24 UTC
Created attachment 35603 [details]
Excel empty file

test.xlsx is an excel file created anew with Microsoft Excel. I attach it here for convenience.
Comment 4 Dominik Stadler 2020-03-28 09:50:24 UTC
This is not how the flags on Workbook and Sheet are intended. 

They both are just flags which indicate to Excel or any other application that formulas should be re-calculated. These flag are available on sheet- or workbook-level, but they are not related to each other in the binary format. 

So Apache POI just populates the binary file with these flags as appropriate and there is no handling to "synchronize" those two in any way. Excel then decides based on the set flags, which sheets it will recalculate.

Adjusted the javadoc via r1875804 somewhat and added tests that verify the current behavior, but as far as I see we should not change anything here.