Management footer

Avatar

Avatar

tafkap95210

Avatar

tafkap95210

tafkap95210

12-01-2021

Hi there,

i need to manage the display of the footer according to the number of pages for a dataset (page in blue / green), but at the end of this data I have to display another different dataset (Page services) which does not have a footer. I don't know how to fix this problem.

 

- Case 1: the content fits on a single page, so we have the following result:

tafkap95210_2-1610456505576.png

- Case 2: the content spills over onto a second page, so the footer should appear at the bottom of the second page:

tafkap95210_3-1610456639844.png

- Case N pages: a lot of content to display there are N pages, the footer must be displayed on the last page:

tafkap95210_4-1610456951193.png

I don't know where I should place my footer, in the ContentArea? On my page ?

 

Any help will be appreciated.

 

 

 

View Entire Topic

Avatar

Avatar

radzmar

MVP

Avatar

radzmar

MVP

radzmar
MVP

14-01-2021

The footer has to be placed always at the bottom I guess? In that case I would do it the following way.

Two masterpages, one for the green/blue content pages one for the orange services pages.

The content page is floating to to bottom and allows page breaks. Here you add an individual subform for the header, contents and footer. 

Header and footer subform are static the content subform is floating and allows page breaks. 

In the content subform you add all the other contents you need and at very last a subform named "spacer" with an height of 0.001 mm. 

This spacer we use to "push" the footer down to the end of the page by simply changing its height, okay?

 

So, assuming the content areas height of the page is 250 mm. When the header and footer each is 50 mm and the content currently is 89 mm, then the spacer subform needs to be 61 mm tall. To determine the heights of dynamic growing objects you can use the xfa.layout.h() method.

 

// Calculate the height of the spacer subform 
// Put this into its layout ready event
var nContentSubformHeight = xfa.layout.h(ContentSubform, "mm"),
    nHeaderFooterHeight = 50,
    nContentAreaHeight = 250,
    nSpacerHeight = nContentAreaHeight - (nHeaderFooterHeight * 2) - nContentSubformHeight;
this.h = nSpacerHeight + "mm";