views:

925

answers:

1

How to hide footer section from a jasper report when it is a subreport. Only show the footer section when it is a main report.

+1  A: 

Jasper Reports uses what they call Print When expressions (if I am not mistaken). It has been a while since I have used it, but each section of the report has a print when expression that you can put a statement to return true or false. So it can check a condition and then decide to show or hide a section. Each subreport also has a print when expression.

My print when expressions are generally in the format of:

( <THE CONDITION TO CHECK> ? Boolean.TRUE : Boolean.FALSE )

The condition can use parameters or values from a column in the report. It is pretty flexible.

There are a couple of very similar questions on SO related to Print When Expressions in Jasper Reports that may also be helpful to you:

http://stackoverflow.com/questions/294989/how-to-use-print-when-expression-in-jasper

http://stackoverflow.com/questions/370454/inclusion-and-exclusion-of-subreports-ireport-jasper

jschoen