cancel
Showing results for 
Search instead for 
Did you mean: 

Print field at last page

Former Member
0 Kudos

I want to print a field only on last page.

Could you help me ?

Regards

Antonella

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Write a condition to display the subform only when the current page number = total number of pages, else subform should be hidden.

This will work for sure.

Thanks,

Raj

Former Member
0 Kudos

Thank you for reply.

Which are the variables for "current page number" and "total number of pages"?

thanks

harman_shahi
Contributor
0 Kudos

Hi Antonella,

When you're placing a field on your form, just place it on the last page (end of all other fields). As long as all the content before this field is wrapped within Flow Layout subform\page, this field will automatically end up on the last page. Or is your requirement more tricky!!

If your requirement is more tricky, then you can use the following codes to get it done:

//Get current page number
var thisPageNum  = xfa.layout.page(this);

//Get total pages
var totalPages = xfa.layout.pageCount();

Hope this helps,

harman

Former Member
0 Kudos

Thank you,

I don't know where i should insert this code.

Could you help me ?

Antonella

Former Member
0 Kudos

Hi,

You can write this code in " FORM READY" . by clicking the drop down menu from the show option in the designer

Former Member
0 Kudos

thank you so much,

I have resolved with yours help.

The form is not "FORM READY" but "FORM LAYOUT".

The complete Code is the following

The complete Code is following

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

var totalPages = xfa.layout.pageCount();

if (totalPages==thisPageNum)

{

TextField1.presence = "invisible"

}

else

{

TextField1.presence = "visible"

}

Regards

Antonella

Answers (1)

Answers (1)

Former Member
0 Kudos

thank you so much,

I have resolved with yours help.

The form is not "FORM READY" but "FORM LAYOUT".

The complete Code is the following

The complete Code is following

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

var totalPages = xfa.layout.pageCount();

if (totalPages==thisPageNum)

{

TextField1.presence = "invisible"

}

else

{

TextField1.presence = "visible"

}

Regards

Antonella