Hide text field if subreport is empty
<p>I am creating a report in <code>Jasper</code> with four parts. Each part consists of a text field as the header and a subreport. The subreport can be empty. If it is empty it is hidden using <em>Remove Line When Blank</em>. This works so far. Now, the corresponding header text field should be hidden too if the subreport is hidden.</p>

<p>I have tried many things but couldn't come up with a solution.
E.g. using <em>Print When Expression</em>: <code>new Boolean ($P{otherField}.read() != -1)</code>. This never showed the header.</p>

<p>As well I tried to hide the header in my Java program but couldn't find an appropriate API command. I guess <code>getBands()[x].getChildren()[y]</code> lead me to the right header but I couldn't hide it there.</p>

<p>Any other ideas?</p>