Thanks Leo.  Your suggestion worked after I wrapped the line with
<jx:forEach>.

 

From: Leo [mailto:leon...@gmail.com] 
Sent: 22 October 2013 14:05
To: jxls-user@lists.sourceforge.net
Subject: Re: [jXLS-user] Copying an Excel template file containing formulas

 

You should write your formula as $[YEARFRAC(B2, TODAY(), 3)]

 

--

Regards,

Leo

 

On Tue, Oct 22, 2013 at 7:16 AM, Manish Java <manish.in.j...@gmail.com>
wrote:

I have been using jXls for a while now.  Recently we have come across some
use cases where we need to output data to an Excel template file that
contains formulas.  For example:

 


Name

Birth date

Age 


John Doe

01-Jan-60

53.8 


Jane Doe

03-Sep-44

69.2 

 

 

jXls is expected to populate the first two columns while the third is
populated using an Excel formula.  The Excel template is as follows:

 


Name

Birth date

Age 


${user.name}

${user.dob}

=YEARFRAC(B2, TODAY(), 3)

 

 

The trouble is that jXls copies the formula verbatim for each row.  So, the
formula becomes "=YEARFRAC(B2, TODAY(), 3)" for every user.

 

Is there a way to get jXls to output the formula correctly for each row?


----------------------------------------------------------------------------
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991
<http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxls-user

 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxls-user

Reply via email to