← Back to team overview

dhis2-devs team mailing list archive

Re: How to get the calculated value from an input formula string ?

 

Oh, Nice to see both of you (Murod and Bob) again at this issue.

[Hehe, I'm so fun]

Thanks for your breaking idea, Bob.
I understood your opinion about this.

"When you save again the calculated values
will be saved" - Bob said right, the calculated values which is saved after
re-open the generated excel file one more time (with a bit of modification
or we can say that is a *ruse*).

Btw, It's so difficult to understand what is happened inside it (the excel
file) ...

Another one, If have any report which just only has got the simple
*SUM *formula
that will be not a big problem now. Don't you think about the combination
formulas as *C1 = SUM( ROUND( DIV( ) )  ) *?*
*
Thank you, thank you so much.

On Mon, Jun 29, 2009 at 6:09 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:

> Hi
>
> I don't know if I have the right understanding of this, but please do
> remember that POI and JXL are only wrappers around the file format -
> they do not replace the formula engine in the spreadsheet application.
> So if you create a spreadsheet using your application (in combination
> with the JXL or POI library) which has a formula in cell C1, then the
> simple act of reading the cell value will not automatically calculate
> it for you.
>
> You would have to open the file in a spreadsheet application (excel,
> openoffice, gnumeric or something similar) in order to trigger the
> evaluation of formulae.  When you save again the calculated values
> will be saved.  Or build your own formula engine which would be a
> pretty big undertaking.  Though I suppose A1+B1 wouldn't be too bad
> ...
>
> Regards
> Bob
>
> ___________________________
> >> From: Hieu Dang Duy <hieu.hispvietnam@xxxxxxxxx>
> >> To: dhis2-devs@xxxxxxxxxxxxxxxxxxx
> >> Sent: Monday, June 29, 2009 11:23:35 AM
> >> Subject: [Dhis2-devs] How to get the calculated value from an input
> >> formula string ?
> >>
> >>
> >> That's a question to resolve the problem as example below :
> >>
> >> I've got three cells as A1, B1 and C1
> >>
> >> A1 contains value as 8   (A1 = 8)
> >> B1 contains value as 10 (B1 = 10)
> >>
> >> and:
> >>
> >> C1 = A1 + B1
> >>
> >> So, how can i get the calculated value as 18 from input formula string
> "A1
> >> + B1" by jxl or POI
> >>
> >> p.s: I could not get directly the pre-calculated value from cell C1 by
> >> jxl.
> >>
> >> Please giving me your experiences about the jxl or POI API !
> >>
> >> --
> >> Hieu.HISPVietnam
> >> Good Health !
> >>
>
>
-- 
Hieu.HISPVietnam
Good Health !

Follow ups

References