Reputation: 31235
I have a Jasper report with legal notices at the end (Enterprise A & Enterprise B):
Those legal notices depend on the content on the report. If Enterprise B is not present, I would like Enterprise A to stick at the bottom of the page like this :
But I do not find any option to do this. Hence "Enterprise A" remains at the same place and there is a space between it and the footer :
I tried the option : "Position type : Relative to bottom" but it does not seem to be intended for that.
Upvotes: 0
Views: 1255
Reputation: 4310
If it's possible to organize the legal notices as a data set (i.e. one row for each notice), then you can use list component in which elements are the notices. If the notices and the footer should be at the bottom of the band/frame, then you may try to set Position Type of the list and the footer to Fix Relative To Bottom (i.e. positions of the footer and bottom edge of the list are fixed relative to the bottom of the band/frame, and list is stretched upward). If the requerement only is the footer should be below the notices, then you may set Position Type of the footer to Float (i.e. if the list is stretched, the footer is moved down accordingly).
Upvotes: 1
Reputation: 522
You don't need more then two fields, try this:
expression for top field:
($F{ENT_A} != null && $F{ENT_B} != null)
? $F{ENT_A}
: ""
expression for bottom field:
($F{ENT_A} != null && $F{ENT_B} != null)
? $F{ENT_B}
: ($F{ENT_A} != null
? $F{ENT_A}
: $F{ENT_B}
Explanation:
If you have A and B, A will be in top field and B in bottom one, If you have only A or B it will show in bottom field
Upvotes: 0
Reputation: 181
The fastest solution I can think of, though it may not be very elegant, is to create a second "Enterprise A" textfield
and position it so that it overlaps "Enterprise B" and then write a Print when
condition for this second "Enterprise A" so that it is visible only when "Enterprise B" is missing. Also, since you probably do not want the first "Enterprise A" field to be visible in this scenario, you would have to add a Print when
condition for it too, so that it is NOT visible when "Enterprise B" is missing.
Upvotes: 1