Jump to content
Changes to the Jaspersoft community edition download ×

Problems with subreports


andre2k2

Recommended Posts

Guys, i am in throuble...

I am trying to compile this JRXML:

 

Code:

<?xml version="1.0" encoding="iso-8859-1"?>
<jasperReport bottomMargin="0" columnCount="1" columnWidth="540"
isSummaryNewPage="false" isTitleNewPage="false" leftMargin="0"
name="cv_subreport_0" pageHeight="168" pageWidth="540"
printOrder="Horizontal" rightMargin="0" topMargin="0">
<queryString><![CDATA[select
t.cart_sequencial,
t.cart_descricao,
t.cart_codg_convenio
from cartoes t
order by
t.cart_codg_convenio,
t.cart_sequencial]]></queryString>
<field class="java.lang.String" name="CART_CODG_CONVENIO"/>
<field class="java.lang.String" name="CART_DESCRICAO"/>
<field class="java.lang.Integer" name="CART_SEQUENCIAL"/>
<group name="CART_CODG_CONVENIO_GROUP">
<groupExpression><![CDATA[$F{CART_CODG_CONVENIO}]]></groupExpression>
<groupHeader>
<band height="20" isSplitAllowed="true">
<textField>
<reportElement forecolor="#000000" height="19"
mode="Transparent" width="532" x="0" y="1"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"
isItalic="false" isUnderline="false"
pdfFontName="Arial" size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["CONVÊNIO: "+$F{CART_CODG_CONVENIO}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
<columnHeader>
<band height="30" isSplitAllowed="true"/>
</columnHeader>
<detail>
<band height="16" isSplitAllowed="true">
<textField>
<reportElement forecolor="#000000" height="16"
mode="Transparent" width="384" x="140" y="0"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" isBold="false"
isItalic="false" isUnderline="false"
pdfFontName="Arial" size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{CART_DESCRICAO}]]></textFieldExpression>
</textField>
<textField>
<reportElement forecolor="#000000" height="16"
mode="Transparent" width="156" x="0" y="0"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"
isItalic="false" isUnderline="false"
pdfFontName="Arial" size="12"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{CART_SEQUENCIAL}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

=====================================================

<?xml version="1.0" encoding="iso-8859-1"?>
<jasperReport bottomMargin="0" columnCount="1" columnWidth="595"
isSummaryNewPage="false" isTitleNewPage="false" leftMargin="0"
name="cv" pageHeight="850" pageWidth="595" printOrder="Horizontal"
rightMargin="0" topMargin="0">
<pageHeader>
<band height="90" isSplitAllowed="true"/>
</pageHeader>
<detail>
<band height="168" isSplitAllowed="true">
<subreport>
<reportElement height="168" width="540" x="28" y="0"/>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["cv_subreport_0.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<pageFooter>
<band height="60" isSplitAllowed="true"/>
</pageFooter>
</jasperReport>

 

Note this is a subreport inside a report... well...

the problem is... when i compile this exception is throwing:

 

Code:
[code]30/05/2007 14:06:50 net.sf.jasperreports.engine.fill.JRFillSubreport prepare
SEVERE: Fill 2950275: exception
net.sf.jasperreports.engine.JRRuntimeException: Subreport overflowed on a band that does not support overflow.

 

How can i fix it? thanxs!!! :D

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Put the subreport in the summary band instead the detail band. That has to work.

I think you can put a sub-report in the detail band only if you are setting one or more subreport parameters with a field result from a query in the master report (I'd like somebody else confirm this).

Hope this helps.

Link to comment
Share on other sites

Try setting a query in your master report. Then the subreport will be generated the same number of rows in the query result set.

Also, try changing the some settings in the tutorial subreport sample.

Hope this helps.

Link to comment
Share on other sites

Nick wrote:

Try setting a query in your master report. Then the subreport will be generated the same number of rows in the query result set.
Also, try changing the some settings in the tutorial subreport sample.
Hope this helps.

 

I did it... but nothing happens :(

The problem persists!!!

Link to comment
Share on other sites

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...