Jump to content
Changes to the Jaspersoft community edition download ×

Out of memory error with multiple subReports


2004 IR Help

Recommended Posts

By: goldgriff - goldgriff

Out of memory error with multiple subReports

2005-08-11 12:55

Hi all

 

I have seen posts reguarding this problem before.

 

I believe that I have found a bug in Jasper, or I am not correctly using subreports. When I generate a report I am getting a out of memory runtime exception. The exception follows. I am able to work around this problem by increasing my page height and witdth. Any ideas on a work around where I create pages that I can print? I have to have the page height bigger than a printable page size.

 

This problem has been reproduced with both Jasper 0.6.8 and 1.0.0.

 

The exeception:

 

Code:

 

 

java.lang.OutOfMemoryError

 

NESTED BY :

net.sf.jasperreports.engine.JRRuntimeException

at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:558)

at net.sf.jasperreports.engine.fill.JRFillBand.prepareElements(JRFillBand.java:525)

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:446)

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:417)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1246)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:571)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:211)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:930)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:428)

at

....

 

Caused by: java.lang.OutOfMemoryError

 

 

 

My main report:

 

Code:

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created using JasperAssistant (http://www.jasperassistant.com) -->

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<!-- NOTE - if I adjust my pageHeight to 1224 this runs -->

<!-- NOTE - if I adjust my pageWidth to letter this does not run -->

<jasperReport name="SupplierQuoteRequestReport" language="java" pageWidth="1009" pageHeight="612" orientation="Landscape" columnWidth="949" leftMargin="30" rightMargin="30" topMargin="30" bottomMargin="30">

<property name="com.jasperassistant.designer.GridWidth" value="12"/>

<property name="com.jasperassistant.designer.GridHeight" value="12"/>

<property name="com.jasperassistant.designer.DataSource" value="SupplierQuote"/>

<property name="com.jasperassistant.designer.SnapToGrid" value="true"/>

<property name="com.jasperassistant.designer.Grid" value="true"/>

<reportFont name="Arial_std" isDefault="true" fontName="Arial" size="11" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<parameter name="reportDirectory" class="java.io.File">

</parameter>

<field name="accountManager" class="java.lang.String">

</field>

<field name="cardPersoQuoteBean" class="java.lang.Object">

</field>

<field name="cardSpecQuoteBean" class="java.lang.Object">

</field>

<field name="cardSpecialist" class="java.lang.String">

</field>

<field name="carrierQuoteBean" class="java.lang.Object">

</field>

<field name="client" class="java.lang.String">

</field>

<field name="combo" class="java.lang.Object">

</field>

<field name="contactsQuoteBean" class="java.lang.Object">

</field>

<field name="currentVersion" class="java.lang.Object">

</field>

<field name="dropShipmentQuoteBean" class="java.lang.Object">

</field>

<field name="estamatedShipDate" class="java.lang.String">

</field>

<field name="orderType" class="java.lang.String">

</field>

<field name="packagingQuoteBeanCardOnly" class="java.lang.Object">

</field>

<field name="packagingQuoteBeanCarrierOnly" class="java.lang.Object">

</field>

<field name="packagingQuoteBeanCarrierWithAffixing" class="java.lang.Object">

</field>

<field name="requestedShipDate" class="java.lang.String">

</field>

<field name="shippingInfoQuoteBean" class="java.lang.Object">

</field>

<field name="submittedDate" class="java.lang.String">

</field>

<field name="versionList" class="java.lang.Object">

</field>

<field name="versionName" class="java.lang.String">

</field>

<field name="versionNumber" class="java.lang.Integer">

</field>

<title>

<band height="76">

<image onErrorType="Blank">

<reportElement positionType="Float" x="0" y="0" width="133" height="49"/>

<graphicElement/>

<imageExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "value_link_logo.jpg"]]></imageExpression>

</image>

<textField pattern="M/d/yy">

<reportElement positionType="Float" x="648" y="0" width="85" height="20"/>

<textElement/>

<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>

</textField>

<staticText>

<reportElement positionType="Float" x="516" y="0" width="120" height="20"/>

<textElement/>

<text><![CDATA[Date Submitted:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="516" y="12" width="120" height="20"/>

<textElement/>

<text><![CDATA[Account Manager:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="516" y="24" width="120" height="20"/>

<textElement/>

<text><![CDATA[Card Specialist:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="516" y="36" width="117" height="20"/>

<textElement/>

<text><![CDATA[Requested Ship Date:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="516" y="48" width="120" height="13"/>

<textElement/>

<text><![CDATA[Client:]]></text>

</staticText>

<textField>

<reportElement positionType="Float" x="648" y="12" width="85" height="16"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{accountManager}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="648" y="24" width="85" height="16"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{cardSpecialist}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="648" y="36" width="85" height="13"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{requestedShipDate}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="648" y="48" width="85" height="13"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{client}]]></textFieldExpression>

</textField>

</band>

</title>

<detail>

<band height="520">

<staticText>

<reportElement positionType="Float" x="0" y="12" width="80" height="16"/>

<textElement/>

<text><![CDATA[Version:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="516" y="12" width="98" height="20"/>

<textElement/>

<text><![CDATA[Estimated Ship Date:]]></text>

</staticText>

<textField>

<reportElement positionType="Float" x="48" y="12" width="101" height="24"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{versionName}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="648" y="12" width="80" height="20"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{estamatedShipDate}]]></textFieldExpression>

</textField>

<subreport>

<reportElement positionType="Float" x="0" y="48" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{cardSpecQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "CardSpecQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="96" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{cardPersoQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "CardPersoQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="144" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{packagingQuoteBeanCardOnly}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "PackagingCardOnlyQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="192" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{carrierQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "CarrierQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="240" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{packagingQuoteBeanCarrierOnly}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "PackagingCarrierOnlyQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="288" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{packagingQuoteBeanCarrierWithAffixing}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "PackagingCarrierAffixedCardQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="336" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{contactsQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "ContactsQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="432" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{shippingInfoQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "ShippingInfoQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

<subreport>

<reportElement positionType="Float" x="0" y="480" width="241" height="37"/>

<dataSourceExpression><![CDATA[$F{dropShipmentQuoteBean}]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{reportDirectory}.getCanonicalPath() + java.io.File.separator + "DropshipmentQuoteSubReport.jasper"]]></subreportExpression>

</subreport>

</band>

</detail>

</jasperReport>

 

 

Example of a sub report:

 

Code:

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created using JasperAssistant (http://www.jasperassistant.com) -->

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="ShippingInfoQuoteSubReport" language="java" pageWidth="791" pageHeight="612" orientation="Landscape" columnWidth="751" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30">

<property name="com.jasperassistant.designer.GridWidth" value="12"/>

<property name="com.jasperassistant.designer.GridHeight" value="12"/>

<property name="com.jasperassistant.designer.DataSource" value="ShippingInfoQuote"/>

<property name="com.jasperassistant.designer.SnapToGrid" value="true"/>

<property name="com.jasperassistant.designer.Grid" value="true"/>

<field name="appointmentRequired" class="java.lang.Boolean">

</field>

<field name="clientPONumber" class="java.lang.String">

</field>

<field name="levelOfService" class="java.lang.Object">

</field>

<field name="preferreFreightProvider" class="java.lang.String">

</field>

<field name="quantity" class="java.lang.Integer">

</field>

<field name="shippingAddress" class="java.lang.String">

</field>

<detail>

<band height="289">

<rectangle>

<reportElement positionType="Float" x="0" y="0" width="169" height="25" backcolor="#0"/>

<graphicElement/>

</rectangle>

<staticText>

<reportElement positionType="Float" x="12" y="0" width="109" height="25" forecolor="#ffffff"/>

<textElement verticalAlignment="Middle"/>

<text><![CDATA[shipping Information]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="0" y="36" width="80" height="20"/>

<textElement/>

<text><![CDATA[Quantity]]></text>

</staticText>

<textField>

<reportElement positionType="Float" x="1" y="62" width="80" height="20"/>

<textElement/>

<textFieldExpression class="java.lang.Integer"><![CDATA[$F{quantity}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="97" y="37" width="168" height="96"/>

<textElement/>

<textFieldExpression class="java.lang.String"><![CDATA[$F{shippingAddress}]]></textFieldExpression>

</textField>

</band>

</detail>

</jasperReport>

 

 

 

 

By: Manfred Moser - mosabua

RE: Out of memory error with multiple subRepo

2005-08-16 11:09

Try putting each subreport into its own group. That has solved sticky situation for me before.

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