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

0

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?

Attachments: 
NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago

12 Answers:

1

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

C-Box's picture
2122
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 day 7 hours ago
0

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

danoldenkamp@gmail.com's picture
Joined: Aug 29 2018 - 11:12am
Last seen: 22 hours 39 min ago
0

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.  

 

Attachments: 
AttachmentSize
Image icon first.png16.46 KB
Image icon second.png22.98 KB
Image icon third.png33.4 KB
NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

Thank you C-Box, I will try your solution!

NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

I have another question: is there a way to break too long line into serveral lines in textFiled. I used property "Stretch with overflow" but it doesn't help. The field just disappears.

NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
1

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

C-Box's picture
2122
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 day 7 hours ago
0

C-Box it dosn't work. Please see screenshoots

Attachments: 
AttachmentSize
Image icon first.png47.04 KB
Image icon second.png57.49 KB
Image icon third.png16.13 KB
Image icon fourth.png15.37 KB
NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

Out of the ScreenShots I can't see the problem... perhaps you can post the jrxml itself, so that I can see the attributes of all (other) elements inside the band.

regards

C-Box

C-Box's picture
2122
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 day 7 hours ago
0

I delete everything and just left two fields and yes, you are right

NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

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.

NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

C-Box, yes it works, there is a property Detail Oveflows for frame. Thank you!

NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
0

 

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).

Attachments: 
AttachmentSize
Image icon first.png33.05 KB
Image icon second.png123.85 KB
Binary Data example.jrxml31.3 KB
NadeinNick's picture
Joined: Nov 5 2019 - 6:05am
Last seen: 4 hours 25 min ago
Feedback