[Bug 63845] New: Forumla not evaluated in 4.1.0

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 63845] New: Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

            Bug ID: 63845
           Summary: Forumla not evaluated in 4.1.0
           Product: POI
           Version: 4.1.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 36826
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36826&action=edit
file created using 4.1.0, cell formulas are not calculated when opening the
file

Cell formulas are not evaluated when created with 4.1.0

E.g. cell.setCellFormula("SUM(A3:A5)"); opens as "0" when opening the excel
file. Same source code compiled with 4.0.1 works and shows correct value when
opening.

If editing the formula (F2) sheet and Enter w/o any change, the formula will be
updated to the correct value. Trying to force call formula calculation from
menu does not help to update the cell value.

Same error / same behavior occurs when copying existing cells to new cells.

In the attached example cell A11 is the cell.setCellFormlua mentioned above.
Column D is copied from column A using the FormulaParser for the formula cells.
As mentioned, the same code works for 4.0.1 but is broken in 4.1.0

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #1 from Joern Muehlencord <[hidden email]> ---
Created attachment 36827
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36827&action=edit
file created using 4.0.1

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #2 from Joern Muehlencord <[hidden email]> ---
Created attachment 36828
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36828&action=edit
source file

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |regression
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Dominik Stadler <[hidden email]> ---
Can you also share the source code that you use to produce the resulting file
out of the source file?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #4 from Joern Muehlencord <[hidden email]> ---
As written, it is basically just

Cell cell = row.createCell (0, CellType.FORMULA);
cell.setCellFormula("SUM(A3:A5)");

See attached test test class (I skipped the copy column part just to keep the
test class simple).

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #5 from Joern Muehlencord <[hidden email]> ---
Created attachment 36907
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36907&action=edit
Test case

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

Joern Muehlencord <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #6 from PJ Fanning <[hidden email]> ---
Comment on attachment 36826
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36826
file created using 4.1.0, cell formulas are not calculated when opening the
file

there does appear to a diff in behaviour between poi-4.0.0 and poi-4.1.1.

in a similar test, poi-4.1.1 wrote `<c r="B3"
t="n"><f>SUM(A1:A3)</f><v>0.0</v></c>` but poi-4.0.0 wrote `<c
r="B3"><f>SUM(A1:A3)</f></c>`.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #7 from PJ Fanning <[hidden email]> ---
in my example, the value should be as the 3 values in the sum are 1,2,3.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #8 from PJ Fanning <[hidden email]> ---
As a workaround, could you add this before saving the workbook (wb)?

  XSSFFormulaEvaluator evaluator = new XSSFFormulaEvaluator(xb);
  evaluator.evaluateAll();

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

--- Comment #9 from Joern Muehlencord <[hidden email]> ---
the workaround helps to get the forumla calculated in both 4.1.0 and 4.1.1.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63845] Forumla not evaluated in 4.1.0

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63845

Petr Michálek <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]