Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Change pageCount for dynamic Form

Avatar

Level 2

Hello,

I am using Livecycle Desinger in SAP. Here i made a Form for working Hours of customers. When i call the Form say with 3 customers (all in one PDF), i have the issue that i am not happy with the pageCount. In most cases for each customer 2 pages are created (can be more). So for 3 Customers i get a PDF with 6 pages. So the numbering is "page 1 of 6", "page 2 of 6" … . What i want is to reset the numbering for each customer, so  i get "page 1 of 2" and "page 2 of 2" for each. I tried to Change the numbering in Pagination of the Masterpage, but as i have 2 Masterpages (Firstpage & FollowingPage), the result is not waht i want either.

I then tried to make my own pageCount and i get my desired result for customers with 2 pages. When a customer has more pages it is wrong. A Customer can get more than 2 pages, as there is a table that grows dynamically. If there are too many rows, another page is necessary. He then has 1 page with Masterpage "Firstpage" and 2 with Masterpage "FollowingPage". The second FollowingPage does not get a pagenumber. I guess it is because i cannot Access it properly with my Code.

In my Code i access the pages via pageSet something like "Form.pageSet[ i ].Masterpage.Subform.Pagenumber.rawValue = value". I guess if theer is more than one page in the pageSet i would Need to access the specific one something like "Form.pageSet[ i ].Masterpage[ j ].Subform.Pagenumber.rawValue = value". But this is not working.

Can anyone help me? Or can you provide me with a better solution?

Thanks in advance

Best Regards

Dennis

1 Accepted Solution

Avatar

Correct answer by
Level 10

Which subform is the pne that get's added a new instance for each customer?

View solution in original post

6 Replies

Avatar

Level 10

I would do it the following way.

A separate masterpage and subform for each customer.

Each masterpage has a text object with two floating fields (pageIndex and pageSpan) for displaying the page counts.

The subforms (customer1, customer2 …) are placed on the corresponding masterpage via the pagination pallette.

1840259_pastedImage_0.png

Avatar

Level 2

Hi radzmar,

I think your way is the right direction. My Form is build quite that way. I have two Masterpages. Just my data is not separated in two subforms as there are not just two, but like 300 customers. In the subform "STAR_FORM_DATERANGES_DATA" includes the main data (the other subforms are for hierachy reasons). On my first Masterpage (Startseite) there are two Content Areas "Header area" and "main area". The data subform "Header" is places in Content area "Header area", "star_month_per_gen" is placed on the the "main area" and Overflows into the second masterpage (Folgeseite), if there is not enough room on the first page. The subform "Tagesergebnisse" is growing according to each customers data. Every customer starts with on page of Masterpage "Startseite" and then Overflows into Masterpage "Folgeseite".

When i now use your code to get the pageSpan of "Star_FORM_DATERANGES", it is always the same, i think it is the pageSpan of the last customer. so if i have 3 customers with customer1 haveing 2 pages (1 Startseite, 1Folgeseite), customer2 having 5 pages (1 Startseite, 4 Folgeseite) and customer3 having 3 pages (1 Startseite, 2 Folgeseite) every page geht's the pageSpan 3.

Do you know why this happens? Do i do something wrong?

Thank you for your help, really appreciate it

P.S.: Here my hierachy:

Hierarchie.PNG

Avatar

Correct answer by
Level 10

Which subform is the pne that get's added a new instance for each customer?

Avatar

Level 2

Each Customer has 1 Masterpage "Startseite" and X Masterpages "Folgeseite". The whole data is in "STAR_FROM_DATERANGES_DATA". In the subform "Tagesergebnisse[1]" there is a growing table for each customer.

Avatar

Level 2

I found another post from you on acrobatusers radzmar

There you used "xfa.resolveNodes("Masterpage[*]").length" to solve the problem and this totally works for me too.

Thank you very much for your time and effort

P.S.: For others having a similar problem, you can look at radzmar​'s solution here:

https://acrobatusers.com/forum/forms-livecycle-designer/renumbering-flowable-subform-pages/

Avatar

Level 1

Got it solved by declaring a increment variable with default value as 1 in the first page and in the second page(flow-able) increase the count by 1. Get the Pagecount per instance by the child node length.

 

Ambika_KS_0-1578660758854.png