=SUM(ABOVE) in apache poi docx. How to write it to cell so that i can calculate sum of above cells

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

=SUM(ABOVE) in apache poi docx. How to write it to cell so that i can calculate sum of above cells

kalra.p@head-in-cloud.com
Hi Team,
I am trying to do something like this :
https://imgur.com/zF7HXpn <https://imgur.com/zF7HXpn>  

But its not calculating when doing the same stuff from code like this :
table.getRow(2).getCell(1).setText("=SUM(ABOVE");





--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: =SUM(ABOVE) in apache poi docx. How to write it to cell so that i can calculate sum of above cells

Dominik Stadler
Hi,

this will not work, you are setting text, not a function, see
http://poi.apache.org/components/spreadsheet/formula.html and
http://poi.apache.org/components/spreadsheet/eval.html for details how to
do it.

Dominik

On Tue, Jul 30, 2019, 00:20 [hidden email] <
[hidden email]> wrote:

> Hi Team,
> I am trying to do something like this :
> https://imgur.com/zF7HXpn <https://imgur.com/zF7HXpn>
>
> But its not calculating when doing the same stuff from code like this :
> table.getRow(2).getCell(1).setText("=SUM(ABOVE");
>
>
>
>
>
> --
> Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: =SUM(ABOVE) in apache poi docx. How to write it to cell so that i can calculate sum of above cells

Dominik Stadler
Ups, sorry, saw to late that you are talking about docx, not xlsx. Not sure
if this is possible there...

Dominik

On Wed, Jul 31, 2019, 07:11 Dominik Stadler <[hidden email]> wrote:

> Hi,
>
> this will not work, you are setting text, not a function, see
> http://poi.apache.org/components/spreadsheet/formula.html and
> http://poi.apache.org/components/spreadsheet/eval.html for details how to
> do it.
>
> Dominik
>
> On Tue, Jul 30, 2019, 00:20 [hidden email] <
> [hidden email]> wrote:
>
>> Hi Team,
>> I am trying to do something like this :
>> https://imgur.com/zF7HXpn <https://imgur.com/zF7HXpn>
>>
>> But its not calculating when doing the same stuff from code like this :
>> table.getRow(2).getCell(1).setText("=SUM(ABOVE");
>>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>