Jump to content
We've recently updated our Privacy Statement, available here ×

How change height of page footer dynamically or how to add second page footer


NadeinNick
Go to solution Solved by C-Box,

Recommended Posts

Hello every one, I have a frame that should be displaed on every page (and frame below), but this frame has a condition and when this condition is true it has to be displayed. When I set an option "Remove Line When Blank" the frame below gets upper and it seems very agly. I forgot to say that both frames are placed in page footer. Before this footer a has a table (dataset) that doesn't rich a bottom of the page becaues there is a frame. How can I split up the page footer on two page footers or may be there is an option to change the size of footer if the first frame is not shown?

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

If I am understanding correctly you are saying that the footer does not have consistent height when a fram has remote a line when blank active and you are looking to have consistent page footer height.

 

Instead of  the "Remove line when blank" property checkbox try a "print when expression" when a field is not like "" or not null.

It will maintain the element height.

 

For a null where condition:

new Boolean($F{Field} == null)

https://community.jaspersoft.com/questions/530555/displaying-textfield-when-not-null

Link to comment
Share on other sites

No, you undestood me incorretly (maybe because I am not native english speaker). Ok I will rewrite it with screnshoots. 

 First I have following template (see First.png file). There is a problem because "Something frame in page footer"  - is a frame that has a condition ("print when expression"), and when condition is false we get something like that (please see second.png). As you can see lower frame got up, and it seems very ugly. But i don't want that lower frame gets up, i want that table continues until lower frame (please see third.png). But I cannot achieve it, because if i have special status higher frame should be shown on every page (see first.png), if the condition is not satisfied I should hide it every where and should get a representation like in third.png.  

 

Link to comment
Share on other sites

  • Solution

Well, the problem  is, that PageFooter Bands are STATIC bands... so they can't stretch itself depending on some content. So this is a normal behaviour and not a bug. Imagine a dynamic pagefooter could cause an infinity loop, when the content causes the pagefooter to increase to a height larger than the page height itself... so you shouldn't use PageFooter Bands for your purpose. Once defined as (e.g.) 100pixel in height, the page footer will use this space at each page and the usage height for other bands is PageHeight -100px.

You could use some some (dummy) group footer bands and use their footer position type (e.g. stack at bottom). Just put your first "dynamic" frame into GroupFooterBand1 (you should set the PrintWhenExpression then to the whole GroupFooterBand) and the second element/frame into GroupFooterBand2 (or if that element should always appear, then you could use of course the normal static page footer band for the second element as well)

Should work (as I've done something similiar some years ago in a customer project, but can't access the sources/jrxmls unfortunately

hth + regards

C-Box

Link to comment
Share on other sites

StretchWithOverflow is the correct way... but you shouldn't set any other StretchType... a common mistake is, that people set this to something like "RelativeToTallestObject" or something like that... so this could cause strange behaviours with self stretching textfields.

So all fields below that "StretchWithOverflow-TextField" should also have PositionType set to float to not overlap each other. They will then moved forwards so that the stretching text will displayed correctly.

hth again + regards

C-Box

Link to comment
Share on other sites

C-Box thank you for your attention. Can you answer: is it possible to put TextField with StretchWithOverflow and also get the same result? Beacuse when I don't put textField in frame it works perfectly, but when there is surrounded frame, it doesn't work. Thank you.

Link to comment
Share on other sites

 

C-Box sorry that I reduced your points, anyway you will get it I promise, but I couldn't resolve my problem. I thought I manage it, but couldn't. I didn't find any property that allow me to print group footer on every page. Please see screnshoots. I attached jrml also (example.jrxml).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...