Search code examples
jasper-reports

Different background band


I would like to display a background or another depending on two variables: total pages and number page, such as:

  • Page 1 - show a rectangle (as a background)
  • Page 2 - show a circle; and
  • Page 3+ - show a triangle

How should I modify the report template?


Solution

  • You have some defined variables in your report, as PAGE_NUMBER Use them in the Option "Print when expression" of your element to show it. (see screenshot) enter image description here