Jump to content
Changes to the Jaspersoft community edition download ×

Rectangle around subreport woes


2005 IR Help

Recommended Posts

By: Charles Hudak - chudak

Rectangle around subreport woes

2004-08-11 09:55

Greetings. I've searched for a post on point but haven't found one.

 

Here's what I am trying to do: I have a main report with 3 subreports in the detail band. I need to draw a rectangle around each subreport. To do this, I've tried to put a rectangle in an element group with the subreport but I keep running into problems.

 

If I set "printWhenDetailOverflows" to true in the rectangle for the first subreport, jasper prints an empty rectangle at the top of the following page(s) if the SECOND subreport overflows the page. I've confirmed this by removing all the rectangles but the one around the first subreport. However, if I don't set this attribute to true then jasper won't draw the rectangle around a subreport portion that overflows to the next page like I need it to.

 

FWIW I'm using 0.5.3 and here's the code for one of my element groups:

 

<elementGroup>

<subreport isUsingCache="true">

<reportElement

mode="Opaque"

x="4"

y="4"

width="525"

height="41"

forecolor="#000000"

backcolor="#FFFFFF"

key="subreport-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="true"

isPrintInFirstWholeBand="true"

isPrintWhenDetailOverflows="false"/>

<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>

<subreportParameter name="URGENT_REPORT_DATASOURCE">

<subreportParameterExpression><![CDATA[]]></subreportParameterExpression>

</subreportParameter>

<dataSourceExpression><![CDATA[$P{URGENT_REPORT_DATASOURCE}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA["reports/subreports/eos_urgent_reports.jasper"]]></subreportExpression>

</subreport>

<rectangle radius="0" >

<reportElement

mode="Transparent"

x="2"

y="2"

width="536"

height="45"

forecolor="#000000"

backcolor="#FFFFFF"

key="rectangle-3"

stretchType="RelativeToTallestObject"

positionType="Float"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="true"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

<graphicElement stretchType="RelativeToTallestObject" pen="Thin" fill="Solid" />

</rectangle>

</elementGroup>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...