I have created three text field in Header. I have put parameter in all textField elements. When I’m not calling one of three parameter of three textField elements. It will show 2 textField elements. The problem now is there are space between the text fields.
How to remove the space?
This is my code:
<textField isBlankWhenNull="true">
<reportElement x="0" y="18" width="555" height="35" isRemoveLineWhenBlank="true"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{daterangefrom} && $P{daterangeto} ? "From ( " + $P{daterangefrom} + " - " + $P{daterangeto} + ")"
: $P{weeks} && $P{monthy} && $P{yrs} ? "For week " + $P{weeks} +" "+ $P{monthy} +" "+ $P{yrs}
: $P{monthy} && $P{yrs} ? "For monthly " +$P{monthy} +" "+ $P{yrs}
: $P{quarter} && $P{yrs} ? "For Quarter " + $P{quarter} +" "+$P{yrs}
: $P{yrs} ? "For " + $P{yrs}
: null]]>
</textFieldExpression>
</textField>
This is mine result:

You can use 3
textFieldelements withisRemoveLineWhenBlankproperty set totruevalue.The sample (jrxml file):
The report design in

iReport:For the parameter1=null, parameter2=null, parameter1=value3 the result will be:

UPDATE
For solving the problem of moving up the
textFieldin case the element above was hide you can use theFramecontainer. You should add 2 frames (one per column) and put 2textFieldelements (2 rows) in each frame.The sample (jrxml file):
The report design in

iReport:For the par1=null, par2=2, par3=3, par4=4 the result will be:

You can compare the results – left side is done without using
frameand the right side withframeelements.