You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by shankarrao <sh...@gmail.com> on 2011/01/25 15:54:33 UTC

Formulas are not getting evaluated when opening the Workbook

I have one of the Workbook cells with a formula associated to it. Please
check the code snippet below for the Formula Cell i am using.
CellUtil.createCell(formulaRow, column,"SUM("A1:A9")",locked);

I see that when i am opening the workbook, the cell is showing the formula
as SUM(A1:A9). The value is not shown as evaluated. Could you please help me
in fixing this.

-Shankar
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Formulas-are-not-getting-evaluated-when-opening-the-Workbook-tp3356398p3356398.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Formulas are not getting evaluated when opening the Workbook

Posted by shankarrao <sh...@gmail.com>.
Got it working.
Thanks for your inputs, Nick.

-Shankar
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Formulas-are-not-getting-evaluated-when-opening-the-Workbook-tp3356398p3359321.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Formulas are not getting evaluated when opening the Workbook

Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 25 Jan 2011, shankarrao wrote:
> I have gone through the FormulaEvaluator section. However i am not clear on
> how to apply it (CellReferences) for my requirement i.e. for formulas such
> as SUM(A1:A9).

It handles all formulas, there's nothing special about ones like Sum

Nick

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


Re: Formulas are not getting evaluated when opening the Workbook

Posted by shankarrao <sh...@gmail.com>.
Nick,

I have gone through the FormulaEvaluator section. However i am not clear on
how to apply it (CellReferences) for my requirement i.e. for formulas such
as SUM(A1:A9). Could you please help me with this.

-Shankar
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/Formulas-are-not-getting-evaluated-when-opening-the-Workbook-tp3356398p3356479.html
Sent from the POI - User mailing list archive at Nabble.com.

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


Re: Formulas are not getting evaluated when opening the Workbook

Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 25 Jan 2011, shankarrao wrote:
> I have one of the Workbook cells with a formula associated to it. Please
> check the code snippet below for the Formula Cell i am using.
> CellUtil.createCell(formulaRow, column,"SUM("A1:A9")",locked);

That creates a text cell. You need to create a formula cell, and then you 
need to evaluate the formula when you're done setting values:
 	http://poi.apache.org/spreadsheet/eval.html

Nick

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