cancel
Showing results for 
Search instead for 
Did you mean: 

Subtotal in PDF for every page ( subtotal in a sheet)

0 Kudos

Hi everyone, hope you are having good and safe days..

Regarding to my question,I have browsed community questions and answers and tried some of the relative ones but still couldn't manage to do it

I need to write subtotal of one column from a table for each page... if in the first page appears 8 rows it should show column's sum of 8 rows, as if it has 14 rows in a second page need to show sum of 14 rows and etc...

Row numbers are not always the same for the page, need to take this also into consideration.

What I am able to do right now is enabled footer to be shown in every page, enabled (Repeat footer on each subsequent page), used FormCalc and got sum of the column, but in this case my footer variable which holds 'Total in sheet :' is writing same data(sum for all rows) into every page.

I am hoping you may help me for this case, your response is highly appreciated. Thank you!

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi and welcome to the SAP Community!

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers(if you haven't already), as it provides tips for preparing questions that draw responses from our members. For example, you can outline what steps you took to find answers (and why they weren't helpful) and share screenshots of what you've seen/done. The more details you provide, the more likely it is that members will be able to assist you.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Best,
Lena
SAP Community Moderator

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Adding this code into Javascript, worked!

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 == "NETWR") {

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

}

}

this.rawValue = total;

We may close this post!

Answers (0)