2016 Apr 18 3:38 PM
Hi Friends,
I am designing Purchase Order using Adobe forms. I Have a requirement where if the data overflows to second page, none of the line item should get printed in the first page and all should only get printed in the second page only.
----- Is there any way to achieve this by Events scripts in Adobe forms or by any other means.
Please let me know.
Thanks in Advance,
Ajeeth
2016 Apr 19 8:09 AM
You can try the below approach if your data above the table is fixed(not flowing) and you already know after how many rows the whole table should flow to the next page.
1) Create a text field of sunken appearance, place this text field just above the table
2) Write a script for this text field wherein count the number of rows in the table and hide the text field if the number of rows will not flow to the next page. Otherwise adjust the height of the textfield so that
it takes on the remaining page and your table automatically flows to the next page entirely
var rowCount;
rowCount = tablename.data.all.length;
if ( rowcount <= "10" ) {
this.presence = "hidden";
} else{
this.height = "20pt"; //try both ways
var height = xfa.layout.h(xfa.resolveNode(textFieldName), "20pt") ); //try both ways
}
3) This script needs to be called before rendering the PDF, so it has to go in layout ready event
I don't have access to LiveCycle designer at the moment else could have checked the javascript as well.
2016 Apr 18 4:44 PM
Do you try set the property go to next content area in pagination tab? Or go to next page?
2016 Apr 19 6:38 AM
Hi Balbino,
Thanks for the reply.
I have set in the table, under over flow --> go to next page. Its flowing properly.
But my requirement is if it is overflowing to second page, none of the line items should get printed on first page. Apart from Header and Footer details all the line items should get printed on second page only, leaving a text "All Line items related to PO are printed on Annexure" in the First page Main window area.
Hope you understand my requirement.
Thanks,
Ajeeth
2016 Apr 19 8:09 AM
You can try the below approach if your data above the table is fixed(not flowing) and you already know after how many rows the whole table should flow to the next page.
1) Create a text field of sunken appearance, place this text field just above the table
2) Write a script for this text field wherein count the number of rows in the table and hide the text field if the number of rows will not flow to the next page. Otherwise adjust the height of the textfield so that
it takes on the remaining page and your table automatically flows to the next page entirely
var rowCount;
rowCount = tablename.data.all.length;
if ( rowcount <= "10" ) {
this.presence = "hidden";
} else{
this.height = "20pt"; //try both ways
var height = xfa.layout.h(xfa.resolveNode(textFieldName), "20pt") ); //try both ways
}
3) This script needs to be called before rendering the PDF, so it has to go in layout ready event
I don't have access to LiveCycle designer at the moment else could have checked the javascript as well.
2016 May 17 12:12 PM
Solved using the below solution.
Inserted blank lines at the top of internal table as much as required to fill the first page and the line items starts to flow in the second page.
Thanks,
Ajeeth
2016 Sep 02 12:18 PM
How did you done please share the code or your approach what you done for achieving that one... Please share the code it will useful for me.