on 01-10-2013 10:23 AM
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.
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;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.