We need a global variable to change the value of it to use it as a flag to detect a the conditional break in java script.
While printing the table details we can detect the values of the current page and as well the previous page.
We will compare the field value of the present page with the previous page dynamically(while printing the output) and then we can change the global variable (flag) to detect the change in value.
Step 1 : Click on 'EDIT' of adobe form layout as shown in the picture
Step 2: Click on form properties and the below popup will be displayed.
Step 3: Click on variables and the below screen will be displayed.
Step 4: Click on '+' and add your variable and set a initial value as 1. I have taken brea here.
Step 5: Take a variable field in master page and open script editor of it. Please follow the below pseudo code to write the code. Write your code in 'Ready Layout' event in java script:
A. var thispage = xfa.layout.page(this);
var fields = xfa.layout.pageContent(thispage-2, "field");
this will give the previous page values of the current page and put the required field value to another variable 'lv1'.
B. var fields1 = xfa.layout.pageContent(thispage-1, "field");
this will give the field value of the current page and put the required field value to another variable 'lv2'.
C. Write the below code to change the flag value:
if ( lv1 == lv2 ) // this will change the flag value as '1' if page break is not found
{
var r = brea.value ;
r = 1 ;
brea.value = String(r) ; // Here you can do your calculations
}
if ( lv1 != lv2) // this will change the flag value as '0' if page break is found
{
var zero = 0;
brea.value = String(zero) ;
}
this.rawValue = brea.value ; // this will display the flag value in the screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |