andre2k2 Posted May 31, 2007 Share Posted May 31, 2007 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 prepareSEVERE: Fill 2950275: exceptionnet.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 More sharing options...
Nick Posted May 31, 2007 Share Posted May 31, 2007 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 More sharing options...
andre2k2 Posted May 31, 2007 Author Share Posted May 31, 2007 But if i put into summary i will lost pageheader and pagefooter session! I cannot lose it :(No any way to do it? Link to comment Share on other sites More sharing options...
arunvishvin Posted May 31, 2007 Share Posted May 31, 2007 Is the second part of the report the subreport or the whole code is the second report. Link to comment Share on other sites More sharing options...
andre2k2 Posted May 31, 2007 Author Share Posted May 31, 2007 arunvishvin wrote:Is the second part of the report the subreport or the whole code is the second report. The second part is the report... and the first is the subreport... Link to comment Share on other sites More sharing options...
andre2k2 Posted May 31, 2007 Author Share Posted May 31, 2007 I saw the subreport sample (http://www.jasperforge.org/images/documentation/jasperreports/samples/MasterReport.pdf) of the tutorial is exactly what i want to do... but i do not undertand how is the diference... why example code works... and why my code do not??? Link to comment Share on other sites More sharing options...
andre2k2 Posted June 1, 2007 Author Share Posted June 1, 2007 No idea, guys? Please... help-me!!! Link to comment Share on other sites More sharing options...
Nick Posted June 1, 2007 Share Posted June 1, 2007 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 More sharing options...
andre2k2 Posted June 2, 2007 Author Share Posted June 2, 2007 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 More sharing options...
andre2k2 Posted June 5, 2007 Author Share Posted June 5, 2007 i solved the problem...the printOrder attribute was wrong... then i changed to vertical and works fine!!! Thank you all, guys!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now