You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/06/25 14:35:57 UTC

DO NOT REPLY [Bug 48256] HSSF-created formulas won't work in Microsoft Excel Viewer

https://issues.apache.org/bugzilla/show_bug.cgi?id=48256

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> 2011-06-25 12:35:57 UTC ---
Excel Viewer displays cached formula results, i.e. the results previously
calculated by Excel or OpenOffice. 

POI doesn't pre-calculate formulas for you, you need to manually pass your
workbook to the formula evaluator.

Add the following line in the end of your code and you will be good:
   workbook.getCreationHelper().createFormulaEvaluator().evaluateAll();

it should work for both .xls and .xlsx formats.

More about evaluation of formulas:
http://poi.apache.org/spreadsheet/eval.html

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org