cancel
Showing results for 
Search instead for 
Did you mean: 

How to summarize a column values into a field

Former Member
0 Kudos

Hi forum

¿ Do you now how to summarize a column table values into one field?

I don´t understand in what event i can to put the code.

And if you can put some code.

For example.


                     |       h1      |        h2       |      h3    |

                     |       rA1    |        rA2      |      rA3   |
                     |       rB1    |        rB2      |      rB3   |
                    ------------------------------------------------------
                     |  rA1 + rB1   |  rA2+ B2       | rA3 + rB3|

Thnks

Josué Cruz

Edited by: Josue Cruz on Sep 2, 2008 12:41 AM

Edited by: Josue Cruz on Sep 2, 2008 12:42 AM

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Josue,

If you have a static table where you know the number of rows and have designed it accordingly in the form then below steps should probably help you.

1. Drag Table control from standard library and select 3 columns and 3 body rows. Select the lnclude Header and Footer Row options and click OK.

2. Select the first cell (Cell1 of Row1) and change its Type to Numeric Field from Object palette. Do this for other cells as well.

3.For cells in footer row, select the calculate event, keep script as Formcalc and enter following code appropriately for the 3 cells.


// Code in cell1 calculate event of footer row.
Sum(Table1.Row1.Cell1, Table1.Row2.Cell1, Table1.Row3.Cell1)

// Code in cell2 calculate event of footer row.
Sum(Table1.Row1.Cell2, Table1.Row2.Cell2, Table1.Row3.Cell2)

// Code in cell3 calculate event of footer row.
Sum(Table1.Row1.Cell3, Table1.Row2.Cell3, Table1.Row3.Cell3)

Chintan

Former Member
0 Kudos

Thanks again for yuor correct reply Chintan

I had a table and i solution this by:

Sum(Tabla1.Row[*].field1)

in the calculate method of my footer table.

For understand the loops in Adobe (with then FOR instruction), into a table. ¿Could you explain to the forum and to me this loop?... star with getting the numbers of rows. plis

Thnks

Atte

Josué Cruz

chintan_virani
Active Contributor
0 Kudos

Josue,

I did not get your question completely but do you want to know what does Row[*] mean?

As per my understanding Row[*] means that it might appear multiple times in the Table1 and calculate sum of all such row instances in table.

Chintan

Former Member
0 Kudos

Hi again Chintan

My first question was answer by you, but for learn a little bit aboute Adobe Form, i wish that if you can explain me how can be a "for" into a table? how can i get the length of rows of a table ?

Thnks Chintan

Edited by: Josue Cruz on Sep 3, 2008 3:09 PM

Answers (0)