Column header (of a specific column) should only be displayed/rendered when in that specific column at least one row in detail band has a value.
I have already a variable which counts the rows where this column has a value. When I print this value in the column header band, it shows "null" - (because column header band is evaluated before details). When I print it in the summary band (which gets evaluated after all the details are rendered, then I get the correct value (e.g. 11 rows of this column have value).
I want to use this value in the print when expression of the column header of this specific column (e.g. $V{MeetingPointCounter} > 0).
I have tried already:
--> setting evaluation time of a test text field in column header band to "report" ($V{MeetingPointCounter} is null)
-> setting evaluation time of a test text field to "column" (getting here the correct number in column header band - e.g. 11 - but when I using the expression $V{MeetingPointCounter} > 0 ? true: false within print when expression of the desired header text field (and the evaluation time of this field is also set to column), it still does not get displayed)
-> If I put the following expression in a test text field within column header band: "$V{MeetingPointCounter} > 0 ? true: false" and put the evaluation time to column, I get "true" displayed
-> If I just put "true" statically in the print when expression of the desired column header, this column header gets properly displayed
This is with jasper reports 5.6.0 (can't go to any newer version. This is given by the product we use).
Desired result:
Display/hide column header of a specific column on condition set by its detail column rows.