on 2014 Mar 12 1:29 AM
Hi,
How can we detect a page break at a runtime using java script? I need to display a data in internal table at header and unique for a document number. i've 10 order list which has multiple items, each of the orders are printed in a new page and i wanted to know this event using a java script which could help me to add some additional logic at header.....pls can someone help on this?
Hello Prabhu,
From your doubt, what I understand is that, You have designed a header in Master Page. You need to fill this header using the Item table which is already designed in the design view(body page). Means you want to fill the Item details(which are in body page) into the header(which is in the master page).
To read the contents from body page into master page, you need to write Javascript code on the header fields(which is in the master page) in the Layout Ready Event.
For example, if you want to fill the field Order_description in header(master page) from the column Order_Description which is in the Item table(body page)
In the form layout, select the order_description field and in the event READY LAYOUT write the below JavaScript code.
var currpage = xfa.layout.page(this);------> Get the current page
var fields = 0;------> Variable to store the number of fields in that page.
fields = xfa.layout.pageContent(currpage-1, "field", 0); ------> Get the number of fields
for ( i=0; i<= fields.length-1; i++ ) ------> Loop on each field on the page
{
if ( fields.name == "ORDER_DESCRIPTION" ) ------> Check if the corresponding field is in the Item table
{
this.rawValue = fields.item(i).rawValue; ------> Assign that value in the Header field
}
}
Repeat the same steps for other fields in the Header. This will work for all Purchase Orders spanned across multiple pages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pavan,
I have a similar requirement ...I need to change the storage location in the header (master page ) to change as the item storage location changes .
I have tried the code ? It is not working .My doubt is should i Bind the header field to some field ?
Thanks and Regards,
Subeesh Kannottil
Not sure about achieving your requirement, but do some R&D on the below script, you may get some idea...
this.rawValue = xfa.layout.page(this);
---
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks naveen but i had already tried this out and infact wont fit my requirement. i am still looking for options....
my program picks Pur.Ords and its line items. the form was already designed to print the PO header in the mainpage followed but its items and this repeats for each new PO where new PO are printed in the following new page. there is a requirement for me to print an item from the PO header to the header designed in master page and to do it i tried with the below script which works for a single PO but not for multiple ones especially when a single PO spans across multiple pages.
var lineno = xfa.layout.page(this);
var path = "xfa.record.PHead.DATA["+(lineno-1)+"].Print";
var tab = xfa.resolveNode(path);
this.rawValue = tab.nodes.item(lineno-1).Allocate.value;
User | Count |
---|---|
66 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.