0
votes

I am using jasper report to download some document in pdf format. I have several subreports and their content may vary according the data coming and hence height of each subreport changes on runtime.

I required to set a border on each subreport after lots of google I found backgroung band can draw the border. Border is shown but its height is not changing according the data coming from database.

Following is my background band:

<background>
    <band height="66" splitType="Stretch">
        <frame>
            <reportElement uuid="dedc4468-e4b5-4aec-8979-0c6b9a0c0ded" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="515" height="66"/>
            <box>
                <topPen lineWidth="2.0" lineStyle="Solid"/>
                <leftPen lineWidth="2.0" lineStyle="Solid"/>
                <bottomPen lineWidth="2.0" lineStyle="Solid"/>
                <rightPen lineWidth="2.0" lineStyle="Solid"/>
            </box>
        </frame>
    </band>
</background>

enter image description here

So my problem is how can I expand or resize the height of the background band?

Note:- I am using dynamic jasper report because the positions of jasper subreport may vary.

1

1 Answers

1
votes

Instead of using the background band to do the border, you could take an alternative approach, using frames to add a border directly to the content bands.

See my answer to this question: How to draw a border around both the column header, footer and detail sections?