2006 IR Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: wilhelm tell - azgard Possible BUG: Deadlock if I use Subreports 2003-05-01 23:33 Hi, I use jasperReports 0.4.6 with J2SDK 1.4.1 on WinXP. My problem is, I have a group-section in my report and this group-section includes in the <groupFooter> a subreport. I can compile and use this subreport as the main-report and the export to PDF is OK. But if the subreport is included in my main-report then it runs in a deadlock in Class JRVerticalFiller on row 583. if (detail.isToPrint()) { while ( detail.getHeight() > columnFooterOffsetY - offsetY ) { fillColumnBreak(JRExpression.EVALUATION_DEFAULT); } Here my report files: Main-Report: <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd";> <jasperReport name="DataSourceReport" pageWidth="595" pageHeight="842" columnWidth="515" columnSpacing="0" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50"> <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="12" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12" isItalic="true" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <parameter name="ImageSubreport" class="dori.jasper.engine.JasperReport"/> <field name="id" class="java.lang.String"/> <field name="arzt" class="java.lang.String"/> <field name="text" class="java.lang.String"/> <group name="CityGroup" minHeightToStartNewPage="700" isStartNewPage="true"> <groupExpression> $F{arzt} </groupExpression> <groupHeader> <band height="20"> <rectangle> <reportElement x="0" y="4" width="515" height="15" forecolor="#C0C0C0" backcolor="#C0C0C0"/> <graphicElement stretchType="NoStretch"/> </rectangle> <textField> <reportElement x="0" y="4" width="515" height="15" backcolor="#C0C0C0" mode="Opaque"/> <textElement textAlignment="Left"> <font reportFont="Arial_Bold"/> </textElement> <textFieldExpression class="java.lang.String"> $F{arzt} </textFieldExpression> </textField> <line> <reportElement x="0" y="19" width="515" height="0"/> <graphicElement stretchType="NoStretch"/> </line> </band> </groupHeader> <groupFooter> <band height="340"> <subreport isUsingCache="true"> <reportElement x="0" y="0" width="520" height="340" backcolor="#FFCC99" isPrintRepeatedValues="false" isPrintWhenDetailOverflows="false" isRemoveLineWhenBlank="false"/> <dataSourceExpression> new reporttests.MyDataSource($F{arzt}) </dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport"> $P{ImageSubreport} </subreportExpression> </subreport> </band> </groupFooter> </group> <detail> <band height="20"> <textField> <reportElement x="0" y="4" width="50" height="15"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"> $F{id} </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="55" y="4" width="200" height="15" positionType="Float"/> <textFieldExpression class="java.lang.String"> $F{arzt} </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="260" y="4" width="255" height="15" positionType="Float"/> <textFieldExpression class="java.lang.String"> $F{text} </textFieldExpression> </textField> <line> <reportElement x="0" y="19" width="515" height="0" forecolor="#808080" positionType="Float"/> <graphicElement stretchType="NoStretch"/> </line> </band> </detail> </jasperReport> And the subreport: <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd";> <jasperReport name="DataSourceReport" pageWidth="595" pageHeight="842" columnWidth="595" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="12" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12" isItalic="true" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <field name="id" class="java.lang.String"/> <field name="arzt" class="java.lang.String"/> <field name="text" class="java.lang.String"/> <field name="imageurl" class="java.lang.Object"/> <detail> <band height="842"> <image scaleImage="RetainShape" hAlign="Center" isUsingCache="false"> <reportElement x="0" y="0" width="595" height="842"/> <graphicElement pen="Thin"/> <imageExpression class="java.net.URL">$F{imageurl}</imageExpression> </image> </band> </detail> </jasperReport> Thank you for any hints. Azgard By: Teodor Danciu - teodord RE: Possible BUG: Deadlock if I use Subreports 2003-05-07 13:34 Hi, The detail section of the subreport is simply too large. It is 842 pixels tall, but in the master report there will be at most 842 - top margin - bottom margin= 742 pixels available. The engine enters a loop trying to create a new page in the document. Please reconsider the layout of your subreport: http://jasperreports.sourceforge.net/tips.tricks.html#largebands Thank you, Teodor 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