51041
2011-04-08 00:45:44 +0000
A major problem with parsing formula
2015-05-31 21:49:20 +0000
1
1
1
Unclassified
POI
HSSF
3.6-dev
All
All
RESOLVED
WORKSFORME
P2
major
---
1
liyt0915
dev
0
oldest_to_newest
145630
0
liyt0915
2011-04-08 00:45:44 +0000
HI,
I found a problem when i set a formula in a cell.
I set some cell's value , and export it , like this.
Cell A1 's value is int(1), cell B1's value is int(2), and a fomula in cell C1 is "=sum(A1+B1)".
When i export this excel file, i find the formula can't calculate right. It shows "#VALUE!".
Then i found something for this problem.
In the last case, poi parsed the formula and the result of tokens was :
1. RefPtg ptgclass (Ptg.CLASS_REF) A1
2. RefPtg ptgclass (Ptg.CLASS_REF) B1
3. AddPtg +
4. FunVarPtg SUM
The excel show it can't work when doing the add action.
And if i parsed the formula "=A1+B1", the result of tokens was :
1. RefPtg ptgclass (Ptg.CLASS_VALUE) A1
2. RefPtg ptgclass (Ptg.CLASS_VALUE) B1
3. AddPtg +
and it calculate right;
so i guess maybe excel only can do add action when the two ptg's ptgclass is Ptg.CLASS_VALUE.
Sorry for my poor english.
145639
1
apache
2011-04-08 07:08:23 +0000
You are aware that you need to use the FormulaEvaluator to calculate the cached formula value? That needs to be done after changing any formulas, and before saving the file. Otherwise you'll get the behaviour you describe of #VALUE! in excel, until you trigger the recalculation
Can you confirm if you're doing a formula evaluation?
183219
2
dominik.stadler
2015-05-31 21:49:20 +0000
No response on the question in the previous comment, therefore closing this as WORKSFORME now. Please reopen the bug with more information if this is still a problem for you.