cancel
Showing results for 
Search instead for 
Did you mean: 

Header data is displaying only on first page for each item but not on Overflow page of that item

sunil_mani
Active Participant
0 Kudos

Hello Experts,

          I will be having multiple headers and multiple items. On each page header data is displayed on the top, in the middle part some text is displayed and the  item data of each group will be displayed in the bottom. Each new group of items should start from new page. When the item doesn't fit in one page, it should overflow to next page and the corresponding header information should also be displayed with same layout. This process repeats for each group of items.

          In my case, all group items are overflown to next page perfectly but the header data is displayed only once for each new group of items. But when these group of items are overflown, header is not displayed.

I have created 2 tables. Header table and Item table. And in context node I have created Loop on header and inside that I have created loop on Item table with where condition. For each header, item group is filtered correctly.

I have created one Master page since I am having same layout on overflown page as well. On the top I have designed my header data in text labels and I have bind this to my header data.

In bottom I have the container "Cont". So this container I have designed in the Design view. The have dragged and dropped the item data in the container. The item data acts as sub form. Sub form is flowed.  Here in place "Following previous" and after "Continue Filling parent" and repeat data for each item with minimum 0 and max is blank. This data sub form is wrapped in another sub form and is bind to item table. Sub form is flowed and after overflow I have given as same container "Cont". And place I have given "On top of container "Cont"" and after "continue filling parent" and repeat data for each item with minimum 0 and max is blank.

For each new group of items new page is triggered correctly and when items don't fit on one page, those are overflown correctly but the header data is getting printed only on first page of each new group of items and not on overflown pages. 

Please help me where I am missing.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

sunil_mani
Active Participant

Now the problem is solved. This can be done by bit of tweaking using JavaScript.

Actually the problem was, the header was printing continuously in subsequent pages and once the header data was over the rest of the pages contained blank header. But we need have to print same header for each group of items till that group of items finish in the specific page. And for new group of items different header will be filled and so on.

So to overcome this issue, create the item table in such a way that the header data is also included in the item table for each group of items. In the layout, select your header field and the event READY LAYOUT and write the below JavaScript code. This event is called for each page for that header field, so you can directly map the item table value and put it in your header field.

// Get the current page

var currpage = xfa.layout.page(this);

// variable to store number of fields in that page.

var fields = 0;      

// Get the number of fields


        fields = xfa.layout.pageContent(currpage-1, "field", 0);

// Loop on each field on the page


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

        {

// Check if the field is in the item table column (it will be actually header data column in your item table)

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

            {

// Fetch that value and store in your header field.


                       this.rawValue = fields.item(i).rawValue;

            }

        }

Former Member
0 Kudos

Thanks Sunil , Now I am dealing with another Issue. I would like to repeat the country name which is getting printed in the Body page in the Master page Footer section.

I will have only one country name per body page. In this case how do I store the country name and populate it in the Master page. Any suggestions Please ?.

Thanks

Swarna

sunil_mani
Active Participant
0 Kudos

I believe you have designed the footer (country) as a text field in the master page and you want to populate this field. So in this case you can create one extra column(country) in the item table where you are displaying. And then u can fill that column in table. Then use the same Javascript code above in the event layout ready of the country field in master page. So here you have to just read the value from the country column of the table and assign to this field. Just Try this. Sorry for the late reply.

Former Member
0 Kudos

Hi Sunil,

Well done and very impressive java scripting. Good job.

Alternatively, let the adobe form to do the job for you.

Add the condition under conditional breaks in Pagination tab of subform; check if header field value changed, start next record in new page.

regards,

Xiang Li

0 Kudos

Hi All,

I have a same requirement but unable to see this at output.

Can any one help please.

Regards

Mohammed

Answers (1)

Answers (1)

former_member230486
Contributor
0 Kudos

Hi,

If you take the header data in master page it will display in every page.So, try to create header data in design view and let me know.

sunil_mani
Active Participant
0 Kudos

Even I want to display the header in all pages. But the header is printing only first time for the new item group. When those items are overflowed, I am not getting the header value on overflowed page. Page layout is same whether its new page or overflowed page.

sunil_mani
Active Participant
0 Kudos

For next new item group, again the header value will print only first time. When those items are overflowed, I am not getting the header value on overflowed page. 😞

Former Member
0 Kudos

Hi Sunil,

   I am also trying to implement the same thing.

   Since it didnt work as expected, I have created a table with nested structure and trying to print- that is also not successful.

   Can you share how you have done this please

    It would be great

Thanks

Swarna