Bug 61863

Summary: Sheet.ForceFormulaRecalculation not overridden by Workbook.ForceFormulaRecalculation
Product: POI Reporter: Luca <miaposta21_>
Component: SS CommonAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.17-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Bug Depends on: 61700    
Bug Blocks:    
Attachments: JUnit test class.
Excel empty file

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.