0

I have a Jasper report with legal notices at the end (Enterprise A & Enterprise B):

enter image description here

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 :

enter image description here

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 :

enter image description here

I tried the option : "Position type : Relative to bottom" but it does not seem to be intended for that.

3 Answers 3

1
+50

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.

1
  • I ended up with this solution. I try to put a bounty on this question. If no better answer exists, I will accept yours. Apr 11, 2014 at 9:40
1

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.