Bug 66611 - XSSFFormulaUtils::updateFormula omits column fixation when only used with column definitions
Summary: XSSFFormulaUtils::updateFormula omits column fixation when only used with col...
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 5.2.3-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-22 13:26 UTC by ben.klossas
Modified: 2023-06-08 10:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ben.klossas 2023-05-22 13:26:27 UTC
In my example the excelsheet consists of the following formula: 
"=VLOOKUP("1000";$B:$C;2;FALSE)"
The Sheet needs to be renamed, which is why XSSFWorkbook::setSheetName is called. The formula is changed to "=VLOOKUP("1000";B:C;2;FALSE)" by this process.

Steps to Reproduce:
1) Use a new (XLSX) Excelsheet and enter the formula "=VLOOKUP("1000";$B:$C;2;FALSE)"

2) Generate a new Excelsheet and change the name of the Excelsheet with POI.

Actual Results: 
An Excelsheet is generated in which the formula is changed to "=VLOOKUP("1000";B:C;2;FALSE)"

Expected Results:
An Excelsheet is generated in which the column fixation isn't omitted


With POI 4.0.1 our application worked: On closer inspection it can be seen that POI 4.0.1 returns "=VLOOKUP("1000";$B$1:$C$1048576;2;FALSE)" which excel, when reopening the file, normalized back to "=VLOOKUP("1000";$B:$C;2;FALSE)". This behaviour is probably not ideal as well, but omitting the fixation entirely can't be correct either.