Yes but  if I write $[n°cell] which refer a cell in the first table, in the 
output file it's replaced by "n°first_cell:n°last_cell", and it means nothing 
for excel.
So I would write the formula by the program, and not by the template. It is may 
be possible using Apache POI, but I prefer to stay in jxls.

From: Leo [mailto:leon...@gmail.com]
Sent: Tuesday, March 15, 2011 3:05 PM
To: Nicolas Retrain
Cc: jxls-user@lists.sourceforge.net
Subject: Re: [jXLS-user] link between two tables

Yes, currently the only way to output a formula is to use $[] notation in Excel 
template.
It can refer to other Excel cells in which you can output required values.

--
Thanks,
Leo


On Tue, Mar 15, 2011 at 3:45 PM, Nicolas Retrain 
<nretr...@infovista.com<mailto:nretr...@infovista.com>> wrote:
Thank you for your reply,

It doesn't work with hidden columns because I don't know the value, the user 
can change it.
Excel macros can work, but often Excel user don't enable macros, so I can't use 
this solution.

I have Thought to add :

*         private String formula= "=E8"; //corresponding to the value in the 
first table.
to the department class, and increment by myself (the program) with the value 
of the next cell; and put ${department2.formula} to the right place in the 
table 2.
But it seems, if I wrote a string in a cell, excel don't auto-compute it, and 
it remain a string.
How can I write a formula in a cell? Something to do in the template?

Regards
Nicolas

From: Leo [mailto:leon...@gmail.com<mailto:leon...@gmail.com>]
Sent: Tuesday, March 15, 2011 2:05 PM
To: jxls-user@lists.sourceforge.net<mailto:jxls-user@lists.sourceforge.net>
Subject: Re: [jXLS-user] link between two tables

Hi Nikolas,

Unfortunately currently it is not supported to have such cross-table links in 
formulas.
So you probably better use some other ways to get what you want.
For example you can try to output the required values from Table1 somewhere in 
Table2 (e.g. in some hidden columns) and then reference these values in 
formulas.
Or try to use Excel macros.

--
Leo
On Tue, Mar 15, 2011 at 11:07 AM, Nicolas Retrain 
<nretr...@infovista.com<mailto:nretr...@infovista.com>> wrote:
Hi all,

I posted yesterday on the help forum but I wasn't very clear.

I am trying to do a link between two tables of a same collection called 
"department".
In the first table I only do a loop on each item "department", and in the 
second I do two loop : first on each "department" and then "employee".

The first table give :

*         The name of the chief;

*         An empty column initialized at 0; it will use to enter the number of 
children of all department employee after the worksheet creation.

The second table :

*         The name of the chief; (first loop)

*         Employee name ;

*         An empty column initialized at 0; it will use to enter the number of 
children of each employee after the worksheet creation.

*         A total children row for each department ;

*         An Excel IF formula : here is my problem. My goal is to verify if the 
sum of children number of each department is the same in the both table. But 
after running the program the formula become : =IF(E8:E10=E31,"ok","error") 
instead of =IF(E8=E31,"ok","error") for the first time, 
=IF(E9=E31,"ok","error") ... jxls replaces of course each cell by a piece of 
column. Can I 
prevent<http://www.mediadico.com/dictionnaire/anglais-francais/prevent/1> this?

I give you my template, and the result in attach files.

You can run it with the basictags example, you just need to add theses :

*         In the main class :  beans.put("departments2", departments) ;

*         In the department class : private int flag=0; (and its getter and 
setter)

*         In the employee class : private int flag=0; (and its getter and 
setter)

I hope you will understand me, and thanks for your help.
Best Regards, Nicolas


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net<mailto:jXLS-user@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jxls-user


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxls-user

Reply via email to