[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Cells with references are not updating
From:       Nicklas Ansman Giertz <nicklas () wrapp ! com>
Date:       2013-04-23 20:32:23
Message-ID: CAKCMfMVJ35ubF0-Ah5TZUNySp52ht4jZqefj=b3FK3MxuKiANQ () mail ! gmail ! com
[Download RAW message or body]


Imagine I have the cell A1 and A2.
A1 contains a numeric value and A2 contains the formula "A1+10"

In the template A1 is blank which causes A2 to have the value "10".

Then in apache poi I write the number "5" to A1 but sadly A2 does't update.

I can force it to update by doing:
cell.setCellFormula(cell.getCellFormula());

After looking through the code I think it's this line that does the trick:
if(_cell.isSetV()) _cell.unsetV();

Can this clearing of pre calculated values be done automatically on all
cels that references A1?

Or if this is not possible is there a prettier solution than "refreshing"
the formula?

I'm using Apache POI 3.9 and I'm writing to an XLSX file.

Regards
Nicklas


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic