cancel
Showing results for 
Search instead for 
Did you mean: 

subtotals in adobe forms

Former Member
0 Kudos

Hi,

Sorry for this question.Although this has been asked a lot of times,i am getting problems.

I want to print the subtotal for each page in adobe forms.I am getting the total at end of last page.

This is the code given in sdn and saptechnical.

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);

var total = 0;

for (var i=0; i <= fields.length-1; i++)

{

if (fields.item(i).name == "PRICE")

{

total = total + fields.item(i).rawValue;

}

}

this.rawValue = total;

But it is not working for me.

Some have also asked to code in the program,but I have no idea about it.

Pls help.

Thanks and regards,

Raka.

Accepted Solutions (0)

Answers (4)

Answers (4)

rakesh_m2
Contributor
0 Kudos

Not sure whether you have still this issue. Code seems to be correct, but make sure that field names which you have declared are different. Suppose, if two fields in that form have same name, this code will not work and make sure to add this code in calculate event and javascript.

This should definetly work.

Please let me know, if you still see some issues.

Thanks,

Rakesh.

Former Member
0 Kudos

Hi Aravind,

Thanks for ur replies.

Sorry for replying late.

Actually,i have already made that change before.

I am calculating the quantity(MENGE) and made the statement as

fields.item(i).name == 'MENGE'.

But it is not working still.

Thanks and regards,

Raka.

Former Member
0 Kudos

Hi Raka,

Add a footer row for your table.

From the object palette -> Pagination, check property 'Include footer row in subsequent pages'.

Add total field in the required cell.

Hide unwanted cells in the footer row.

In the calculate event of the total field use the following script in formCalc

sum(Table1.Row1[*].amount[*])

Hope this will help.

Regards,

Sanoosh

Former Member
0 Kudos

Hi someone pls help me?

Thanks and regards,

Raka.

Former Member
0 Kudos

I believe this is the code to get Total at the last page. What is the issue that you are facing?

Thanks,

Aravind

Former Member
0 Kudos

Hi Aravind,

Thanks for your reply.

I am getting the total at the last page with this formula written in formcalc: sum(I_EKPO.DATA[*].MENGE)

What i need is subtotals at each page of the form.

I have checked saptechnical and sdn and there i have got this code to get the subtotal.

But this is not working for me.. Pls help

Thanks and regards,

Raka.

Former Member
0 Kudos

PRICE should be the name of the UI element whose data you are trying to add up. Check the same.

fields.item(i).name == "PRICE".

Thanks,

Aravind

Former Member
0 Kudos

Hi someone pls help me?

Thanks and regards,

Raka.