0

I am using JasperReports 6.20.5. I have a group header in a subreport that contains 5 frames. It looks like this:

<groupHeader>
    <band height="100" splitType="Prevent">
        <frame>
            <reportElement key="frame" style="gh3band1" positionType="Float" stretchType="ElementGroupBottom" x="0" y="0" width="540" height="20" uuid="a39f5b9c-c87c-40d4-9f5f-52c6d8d30620"/>
            <staticText>
                <reportElement style="gh3text1" stretchType="ContainerBottom" x="0" y="0" width="140" height="20" uuid="730c7a3c-f113-414f-aa23-6aca44de912d"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none"/>
                <text><![CDATA[nombre]]></text>
            </staticText>
            <textField textAdjust="StretchHeight" isBlankWhenNull="true">
                <reportElement key="textField" style="gf3text2" stretchType="ContainerBottom" x="140" y="0" width="400" height="20" uuid="1c3db8a2-a486-434b-8acc-5c2cd885929a"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none"/>
                <textFieldExpression><![CDATA[$F{nombre_1}]]></textFieldExpression>
            </textField>
        </frame>
        <frame>
            <reportElement key="frame" style="gh3band1" positionType="Float" stretchType="ElementGroupBottom" x="0" y="20" width="540" height="20" uuid="42433560-660f-4dd9-99f9-de67fa63251d"/>
            <staticText>
                <reportElement style="gh3text1" stretchType="ContainerBottom" x="0" y="0" width="140" height="20" uuid="5861139d-f5fe-4e09-a4f7-2bd90a8b2525"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none"/>
                <text><![CDATA[tipo]]></text>
            </staticText>
            <textField textAdjust="StretchHeight" isBlankWhenNull="true">
                <reportElement key="textField" style="gf3text2" stretchType="ContainerBottom" x="140" y="0" width="400" height="20" uuid="b9fb216c-ddcb-4217-b318-b4b13a8d031e"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none"/>
                <textFieldExpression><![CDATA[$F{descripcion_larga_1_1}]]></textFieldExpression>
            </textField>
        </frame>
        and 3 more frames just like the previous 2
    </band>
</groupHeader>

All frames have positionType="Float" and stretchType="ElementGroupBottom"; every frame contains a staticText and a textField; all static texts have stretchType="ContainerBottom"; all text fields have textAdjust="StretchHeight".

Everything works fine EXCEPT the first stretchable frame; and I need them all to be stretchable. The first one always stretches to the height of the tallest text field in the group header. I tried many combinations of parameters, interchanged the position of the frames, etc, etc, etc, always with the same result. And when I changed the stretch type of the first frame to not stretch, the next frame was stretched incorrectly. If all frames are stretchable the header looks like this:

enter image description here

Or like this:

enter image description here

Jorge Campins
  • 413
  • 1
  • 4
  • 11

0 Answers0