I am using iReport. I want to know how to make an auto height rectangle?
as per this sample image of detail band. There is two part one is data part on right side which fetch data and show. and left side part is a textarea data which is passed as parameter. I want to make both rectangle same height. It may possible that left side data height is bigger than right side part and vice versa. So I want to make both rectangle height same all the time.
For achieving this i use following code. where I don't use rectangles but a lines only
<columnHeader>
<line>
<reportElement x="0" y="28" width="555" height="1" uuid="9d2cb019-77f2-47a0-94f7-aa944b5c277e"/>
</line>
</band>
</columnHeader>
<detail>
<band height="13" splitType="Stretch">
<textField>
<reportElement x="472" y="0" width="50" height="13" uuid="4b51d986-b6f9-45e2-a151-e9d7f86007f3"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{packing}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="526" y="0" width="27" height="13" uuid="930cf91c-710a-40c4-a899-fde5ddfd7ce4"/>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{sli_pack}]]></textFieldExpression>
</textField>
<line>
<reportElement x="471" y="0" width="1" height="13" uuid="434d1954-3286-4539-a3d9-915f28364210"/>
</line>
<line>
<reportElement x="555" y="-1" width="1" height="13" uuid="39dab81d-1bb3-41bd-8fff-9780b7f65672"/>
</line>
<line>
<reportElement x="0" y="-1" width="1" height="13" uuid="8936db56-872f-434d-a39b-298ffdb99e57"/>
</line>
</band>
</detail>
<summary>
<band height="1" splitType="Stretch">
<line>
<reportElement x="0" y="-1" width="555" height="1" uuid="ba7dbcc7-fd20-4ee9-b593-480737f9b88c"/>
</line>
</band>
</summary>
But the issue with this way is corners of rectangle is not properly printed.
My questions are:
1) Is there any better way to do this?
2) how to draw a border of complete detail band?
3) How to do this with rectangle ?
Here is another try with rectangle around detail band but rectangle is repeated to each row.
<detail>
<band height="13" splitType="Stretch">
<rectangle>
<reportElement stretchType="RelativeToTallestObject" x="1" y="0" width="552" height="13" uuid="80b946be-ac5f-495d-a507-fec3e22ea751"/>
</rectangle>
<textField>
<reportElement x="465" y="0" width="50" height="13" uuid="4b51d986-b6f9-45e2-a151-e9d7f86007f3"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{packing}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="526" y="0" width="27" height="13" uuid="930cf91c-710a-40c4-a899-fde5ddfd7ce4"/>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{sli_pack}]]></textFieldExpression>
</textField>
</band>
</detail>
