Document is empty in Jasper Studio - jasper-reports

i am using a oracle data adapter. when i put my query in sql developer it returns value. but in jasper it shows document is empty. is their any way to check if my data adapter is working properly or not?
i am new in jasper studio. if any setting need to change please mention. i am using oracle 11G express edition.
here is my jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.11.0.final using JasperReports Library version 6.11.0-0c4056ccaa4d25a5a8c45672d2f764ea3498bebb -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Cherry_2" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="13acf49e-4913-4d1b-bccc-113817ad15d1">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="KHALID"/>
<style name="Title" forecolor="#FFFFFF" fontName="Times New Roman" fontSize="50" isBold="false"/>
<style name="SubTitle" forecolor="#CCCCCC" fontName="Times New Roman" fontSize="18" isBold="false"/>
<style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true"/>
<style name="Detail" mode="Transparent" fontName="Times New Roman"/>
<style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style mode="Opaque" backcolor="#F0EFEF"/>
</conditionalStyle>
</style>
<queryString language="SQL">
<![CDATA[select c.productname, sum(b.quantity)
from orders a, orderdetails b, products c
where a.orderid = b.orderid
and b.PRODUCT = c.id
group by c.productname]]>
</queryString>
<field name="PRODUCTNAME" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="PRODUCTNAME"/>
</field>
<field name="SUM(B.QUANTITY)" class="java.math.BigDecimal">
<property name="com.jaspersoft.studio.field.label" value="SUM(B.QUANTITY)"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="132" splitType="Stretch">
<image>
<reportElement x="456" y="0" width="99" height="132" uuid="97705585-a0b5-4ec7-86f3-ae10c220e6af"/>
<imageExpression><![CDATA["cherry.jpg"]]></imageExpression>
</image>
<frame>
<reportElement mode="Opaque" x="0" y="0" width="451" height="95" backcolor="#000000" uuid="6c6ca4e1-17cd-4913-93d6-5e670ea9ae8a"/>
<staticText>
<reportElement style="Title" x="0" y="0" width="370" height="66" uuid="a2a2cac8-5a7d-4487-8c54-dab235ce4e21"/>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[Cherry Title]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="157" y="66" width="249" height="29" uuid="8978eac3-c578-41c9-837e-48d2b0184642"/>
<textElement>
<font size="22" isBold="false"/>
</textElement>
<text><![CDATA[Cherry SubTitle]]></text>
</staticText>
</frame>
<frame>
<reportElement mode="Opaque" x="0" y="100" width="451" height="32" forecolor="#000000" backcolor="#CC0000" uuid="e3c14156-5b51-4201-918b-97fdc012e5d4"/>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="307" y="12" width="144" height="20" forecolor="#FFFFFF" uuid="5c3301e7-a737-4c59-8a2f-a6c79fd1adb8"/>
<textElement textAlignment="Right">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="26" splitType="Stretch">
<staticText>
<reportElement style="Column header" x="0" y="7" width="277" height="18" forecolor="#000000" uuid="a6b37150-9bee-492a-b969-f034f64edf4c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="e1446586-9fcf-432d-9dd5-955ccb125ee4"/>
</reportElement>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[PRODUCTNAME]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="277" y="7" width="277" height="18" forecolor="#000000" uuid="6d1296a7-fb7c-46ca-9371-77d96da01824">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="dd4b0dcc-1ffd-4aa0-9af2-c6c23bcffe7d"/>
</reportElement>
<textElement>
<font isBold="false"/>
</textElement>
<text><![CDATA[SUM(B.QUANTITY)]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<frame>
<reportElement style="Row" mode="Opaque" x="0" y="0" width="555" height="18" uuid="b50221b5-8254-440b-8c6f-1f0b138c9259"/>
<textField textAdjust="StretchHeight">
<reportElement style="Detail" positionType="Float" x="0" y="0" width="277" height="18" uuid="3c5fe24a-0a12-4767-98ee-528641a8400b">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="e1446586-9fcf-432d-9dd5-955ccb125ee4"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{PRODUCTNAME}]]></textFieldExpression>
</textField>
<textField textAdjust="StretchHeight">
<reportElement style="Detail" positionType="Float" x="277" y="0" width="277" height="18" uuid="f11c3ade-0bb6-4270-820f-639e51664491">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="dd4b0dcc-1ffd-4aa0-9af2-c6c23bcffe7d"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{SUM(B.QUANTITY)}]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<columnFooter>
<band height="7" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1" uuid="1133a906-5b71-476e-9f3e-bc97c97058c1"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="0" y="1" width="555" height="24" forecolor="#D0B48E" backcolor="#000000" uuid="729c3539-f946-4d0e-a0a7-bda2815ea1b0"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="513" y="0" width="40" height="20" forecolor="#FFFFFF" uuid="4834e99c-7f6c-485a-b098-50e5187f2ab4"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="433" y="0" width="80" height="20" forecolor="#FFFFFF" uuid="9825b46e-76f1-469a-abb8-a1cc27aad685"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="2" y="1" width="197" height="20" forecolor="#FFFFFF" uuid="137d38c7-1a83-4fc5-b156-9d5f1b1a0ddc"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>

This problem happened to me once and I solved it confirmed the changes and it was not bringing data, in oracle run:
commit;

Related

Jasper report list element produces extra page

Here are some screen shots to demonstrate the problem:
First, here is the design with no list element:
And here is the result of that report (note that there are two pages):
Now if I add the list element, here is the design:
Here is the jrxml for the summary band:
<summary>
<band height="554">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
<staticText>
<reportElement positionType="Float" x="80" y="30" width="100" height="20" uuid="3210d220-35e0-4984-a00d-be4ad58feca4"/>
<text><![CDATA[Static Text]]></text>
</staticText>
<rectangle radius="5">
<reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC" uuid="88870baf-afe8-4c0a-9b5f-fe88eb0f4dd3"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="5" y="0" width="113" height="16" uuid="9231dea5-26f2-40a8-8b45-2ce560e0f2ba"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Design Parameters]]></text>
</staticText>
<componentElement>
<reportElement x="0" y="16" width="284" height="13" uuid="12a8a577-6c77-4849-84c6-362544413192">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="DrawingRevisionParameters" uuid="5ff517f3-e25b-4ed5-8589-33076f52c2c2">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="13" width="284">
<textField pattern="#,##0.####">
<reportElement x="0" y="0" width="50" height="12" uuid="9239498a-9b30-495f-a571-b505fceba75a"/>
<textElement textAlignment="Right">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="54" y="0" width="72" height="12" uuid="f2c8d327-e8b4-4f5b-af0c-dad19c0fc4bb"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="132" y="0" width="150" height="12" uuid="0e48fb28-af4b-4fac-8069-63bc1f880d80"/>
<textElement markup="rtf">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</summary>
And finally here is the result of that report.
Note that the floating "Static Text" label moved down appropriately, but not nearly enough to add an extra page to the report. However, you'll see that there are now 3 pages to the report anyway.
The only thing that changed was adding the list element. How can I make it so that it doesn't add the extra page? Or what am I not understanding with regard to lists? I could probably also pass the data into a sub-report so that the data is presented in the detail band of the sub-report, but I would much prefer to use a list if I could, since it seems much simpler to me. I am using version 6.6.0. Thanks!
Here is the full jrxml as requested (uuids removed to save on characters):
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Drawing" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" whenResourceMissingType="Error">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<subDataset name="DrawingRevisionNotes">
<queryString>
<![CDATA[]]>
</queryString>
<field name="orderNum" class="java.lang.Integer">
<fieldDescription><![CDATA[orderNum]]></fieldDescription>
</field>
<field name="drawingNote" class="com.engineering.domain.drawings.DrawingNote">
<fieldDescription><![CDATA[drawingNote]]></fieldDescription>
</field>
</subDataset>
<subDataset name="DrawingApprovals">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="revisionID" class="java.lang.String">
<fieldDescription><![CDATA[revisionID]]></fieldDescription>
</field>
<field name="drafter" class="java.lang.String">
<fieldDescription><![CDATA[drafter]]></fieldDescription>
</field>
<field name="approver" class="java.lang.String">
<fieldDescription><![CDATA[approver]]></fieldDescription>
</field>
<field name="approvalDate" class="java.lang.String">
<fieldDescription><![CDATA[approvalDate]]></fieldDescription>
</field>
</subDataset>
<subDataset name="DrawingRevisionParameters">
<queryString>
<![CDATA[]]>
</queryString>
<field name="drawingParameterID" class="java.lang.Integer">
<fieldDescription><![CDATA[drawingParameterID]]></fieldDescription>
</field>
<field name="parameter" class="com.engineering.domain.drawings.DrawingParameter">
<fieldDescription><![CDATA[parameter]]></fieldDescription>
</field>
<field name="orderNum" class="java.lang.Integer">
<fieldDescription><![CDATA[orderNum]]></fieldDescription>
</field>
</subDataset>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["static/"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<field name="draftCount" class="java.lang.Integer">
<fieldDescription><![CDATA[draftCount]]></fieldDescription>
</field>
<field name="releaseType" class="com.engineering.domain.drawings.DrawingReleaseType">
<fieldDescription><![CDATA[releaseType]]></fieldDescription>
</field>
<field name="releaser" class="com.humanresources.domain.Employee">
<fieldDescription><![CDATA[releaser]]></fieldDescription>
</field>
<field name="releaseTimeStamp" class="java.time.LocalDateTime">
<fieldDescription><![CDATA[releaseTimeStamp]]></fieldDescription>
</field>
<field name="company" class="com.companies.domain.Company">
<fieldDescription><![CDATA[company]]></fieldDescription>
</field>
<field name="unitSystem" class="com.utilities.domain.units.UnitSystem">
<fieldDescription><![CDATA[unitSystem]]></fieldDescription>
</field>
<field name="drawingReleaseID" class="java.lang.Integer">
<fieldDescription><![CDATA[drawingReleaseID]]></fieldDescription>
</field>
<field name="fullDescription" class="java.lang.Boolean">
<fieldDescription><![CDATA[fullDescription]]></fieldDescription>
</field>
<field name="drawingRevision" class="com.engineering.domain.drawings.DrawingRevision">
<fieldDescription><![CDATA[drawingRevision]]></fieldDescription>
</field>
<background>
<band height="554" splitType="Stretch">
<rectangle radius="5">
<reportElement mode="Transparent" x="0" y="0" width="752" height="553"/>
</rectangle>
<frame>
<reportElement x="485" y="443" width="267" height="110">
<property name="ShowOutOfBoundContent" value="false"/>
</reportElement>
<rectangle radius="5">
<reportElement mode="Transparent" x="0" y="0" width="267" height="110"/>
<graphicElement>
<pen lineWidth="1.0"/>
</graphicElement>
</rectangle>
<subreport>
<reportElement x="0" y="0" width="180" height="34"/>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR}+"HeaderSmall.jasper"]]></subreportExpression>
</subreport>
<line>
<reportElement x="0" y="35" width="180" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<staticText>
<reportElement x="39" y="36" width="21" height="7"/>
<textElement>
<font size="5"/>
</textElement>
<text><![CDATA[Title]]></text>
</staticText>
<textField>
<reportElement x="44" y="40" width="136" height="47"/>
<textElement verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getTitle()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="39" y="90" width="21" height="7"/>
<textElement>
<font size="5"/>
</textElement>
<text><![CDATA[Drawing]]></text>
</staticText>
<textField>
<reportElement x="44" y="94" width="136" height="16"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[String.format("%06d",$F{drawingRevision}.getDrawing().getDrawingID())+" Rev "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
</textField>
<line>
<reportElement x="38" y="36" width="1" height="74"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="180" y="0" width="1" height="110"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="39" y="89" width="141" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<frame>
<reportElement x="0" y="36" width="37" height="74"/>
<staticText>
<reportElement x="2" y="2" width="33" height="7"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Tolerances]]></text>
</staticText>
<textField>
<reportElement x="2" y="9" width="33" height="20"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{unitSystem}.getUnitTolerance().getUnit().getUnitNamePlural()+"\nUnless\nNoted"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="29" width="33" height="33"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true"/>
</textElement>
<textFieldExpression><![CDATA[($F{unitSystem}.getUnitTolerance().getTolerance3Place()!=null ? "X.XXX ±"+$F{unitSystem}.getUnitTolerance().getTolerance3Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance2Place()!=null ? "X.XX ±"+$F{unitSystem}.getUnitTolerance().getTolerance2Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance1Place()!=null ? "X.X ±"+$F{unitSystem}.getUnitTolerance().getTolerance1Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getFractional()!=null ? "Frac. ±"+$F{unitSystem}.getUnitTolerance().getFractional()+"\n" : "")+
"Ang. ±30'"]]></textFieldExpression>
</textField>
</frame>
<frame>
<reportElement x="180" y="0" width="87" height="109"/>
<componentElement>
<reportElement x="3" y="14" width="81" height="9">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Approvals"/>
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="DrawingApprovals">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getApprovals())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="9" width="81">
<textField>
<reportElement x="0" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{revisionID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="17" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{drafter}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="34" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{approver}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="51" y="0" width="30" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{approvalDate}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="3" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[REV]]></text>
</staticText>
<staticText>
<reportElement x="20" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[BY]]></text>
</staticText>
<staticText>
<reportElement x="37" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[APV]]></text>
</staticText>
<staticText>
<reportElement x="54" y="3" width="30" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[DATE]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement x="3" y="14" width="81" height="0">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<textFieldExpression><![CDATA["PRELIMINARY REVISION "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
</textField>
<line>
<reportElement positionType="Float" x="3" y="17" width="82" height="1">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="3" y="20" width="82" height="0">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA["REV BY APV DATE\n - "+$F{drawingRevision}.getDrafter().getInitials()]]></textFieldExpression>
</textField>
</frame>
</frame>
</band>
</background>
<detail>
<band height="554" splitType="Stretch">
<image scaleImage="RetainShape">
<reportElement x="5" y="5" width="742" height="548"/>
<imageExpression><![CDATA["\\\\SERVER\\Data\\Design Files\\Drawings\\ERP Draft Images\\"+String.format("%05d",$F{drawingRevision}.getDrawing().getDrawingID())+$F{drawingRevision}.getRevision().getRevisionID()+($F{draftCount}>1 ? "p"+$F{draftCount} : "")+".jpg"]]></imageExpression>
</image>
<componentElement>
<reportElement x="4" y="420" width="400" height="30">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Notes"/>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="DrawingRevisionNotes">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getNotes())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30" width="400">
<staticText>
<reportElement x="0" y="0" width="48" height="14"/>
<text><![CDATA[NOTES]]></text>
</staticText>
<textField>
<reportElement x="0" y="14" width="15" height="14"/>
<textFieldExpression><![CDATA[$F{orderNum}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="16" y="14" width="384" height="14"/>
<textFieldExpression><![CDATA[$F{drawingNote}.getNoteText()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<frame>
<reportElement x="485" y="405" width="267" height="38">
<printWhenExpression><![CDATA[$F{drawingRevision}.getMaterial()!=null]]></printWhenExpression>
</reportElement>
<rectangle radius="5">
<reportElement x="0" y="0" width="267" height="38"/>
</rectangle>
<staticText>
<reportElement x="4" y="0" width="100" height="13"/>
<text><![CDATA[Material]]></text>
</staticText>
<line>
<reportElement x="4" y="12" width="259" height="1"/>
</line>
<staticText>
<reportElement x="138" y="0" width="61" height="13"/>
<text><![CDATA[Coating]]></text>
</staticText>
<staticText>
<reportElement x="199" y="0" width="64" height="13"/>
<text><![CDATA[Notes]]></text>
</staticText>
<textField>
<reportElement x="4" y="13" width="134" height="24"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialRaw().getShortDescriptionNoCondition() + ( $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription().trim() == "" ? "" : ", "+$F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() )]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="138" y="13" width="61" height="24"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialCoating()==null ? "" : $F{drawingRevision}.getMaterial().getMaterialCoating().getCoatingDescription()]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="199" y="13" width="64" height="24"/>
<textElement>
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialNotes()]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<pageFooter>
<band height="12" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="418" height="12"/>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{releaseTimeStamp}+" Release ID: "+$F{drawingReleaseID}+" "+$F{company}.getCompanyName()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="430" y="0" width="257" height="12"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[This proprietary drawing shall not be shared without written permission.]]></text>
</staticText>
<textField>
<reportElement x="687" y="0" width="50" height="12"/>
<textElement textAlignment="Right">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="737" y="0" width="15" height="12"/>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="554">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
<frame>
<reportElement x="467" y="1" width="284" height="318">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
</reportElement>
<box>
<pen lineWidth="0.25"/>
</box>
<rectangle radius="5">
<reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="5" y="0" width="113" height="16"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Design Parameters]]></text>
</staticText>
<componentElement>
<reportElement x="0" y="16" width="284" height="13">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="DrawingRevisionParameters">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="13" width="284">
<textField pattern="#,##0.####">
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Right">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="54" y="0" width="72" height="12"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="132" y="0" width="150" height="12"/>
<textElement markup="rtf">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</frame>
<staticText>
<reportElement positionType="Float" x="560" y="319" width="100" height="30"/>
<text><![CDATA[Static Text]]></text>
</staticText>
</band>
</summary>
</jasperReport>
I've encountered this before and the fixes I did was.
Check the size of the detail band and make sure that the list of values generated can all fit into the same page. Reduce the size of the detail band to see the difference.
Another is hide bands that are not in use or empty. For example try hiding the Summary band by setting it's Print When Expression to Boolean.FALSE.
You can also go to Report Properties > Check off Ignore Pagination Property

Why is my expression off by 1 record?

I have a report that i am making using iReport and I have an equation that is helping me find duplicate Estimated Shipping variables and make the initial number stay the same but the ones displayed after it appear as 0. I want this because the report shows the changes made to the Sales Order but I dont want the report showing that the person was charged the initial Estimated Shipping ammount- every time.
The equation I am using to find the duplicates is
$V{SOID_Count}<=1?$F{SOITEM_UNITPRICE}:0
This works but if you notice in this picture the numbers are behind by one.
It is subtracting the Estimated Shipping amount that was above it- from the current Actual Shipping amount that you are on.
So how can I alter my counter equation to fix this?
Thank you for any help!
This is my XML
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ShippingPriceDifference" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="97636279-f825-4b72-b9f8-8ce9740dce34">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="To" class="java.util.Date">
<parameterDescription><![CDATA[asdf]]></parameterDescription>
</parameter>
<parameter name="From" class="java.util.Date"/>
<queryString>
<![CDATA[SELECT
CUSTOMER."NAME" AS CUSTOMER_NAME,
SO."NUM" AS SO_NUM,
COMPANY."NAME" AS COMPANY_NAME,
SHIPCARTON."FREIGHTAMOUNT" AS SHIPCARTON_FREIGHTAMOUNT,
SHIP."SOID" AS SHIP_SOID,
SOITEM."UNITPRICE" AS SOITEM_UNITPRICE,
PRODUCT."PARTID" AS PRODUCT_PARTID,
SHIP."DATESHIPPED" AS SHIP_DATESHIPPED,
SOITEM."SOID" AS SOITEM_SOID
FROM
"CUSTOMER" CUSTOMER INNER JOIN "SO" SO ON CUSTOMER."ID" = SO."CUSTOMERID"
INNER JOIN "SHIP" SHIP ON SO."ID" = SHIP."SOID"
INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"
INNER JOIN "PRODUCT" PRODUCT ON SOITEM."PRODUCTID" = PRODUCT."ID"
INNER JOIN "SHIPCARTON" SHIPCARTON ON SHIP."ID" = SHIPCARTON."SHIPID",
"COMPANY" COMPANY
WHERE
PRODUCT."PARTID" = 947
AND SHIP."DATESHIPPED" BETWEEN $P{From} AND $P{To}
AND SHIPCARTON."FREIGHTAMOUNT" != 0
ORDER BY
2 ASC]]>
</queryString>
<field name="CUSTOMER_NAME" class="java.lang.String"/>
<field name="SO_NUM" class="java.lang.String"/>
<field name="COMPANY_NAME" class="java.lang.String"/>
<field name="SHIPCARTON_FREIGHTAMOUNT" class="java.lang.Double"/>
<field name="SHIP_SOID" class="java.lang.Integer"/>
<field name="SOITEM_UNITPRICE" class="java.lang.Double"/>
<field name="PRODUCT_PARTID" class="java.lang.Integer"/>
<field name="SHIP_DATESHIPPED" class="java.sql.Timestamp"/>
<field name="SOITEM_SOID" class="java.lang.Integer"/>
<variable name="shipPriceDif" class="java.lang.Double">
<variableExpression><![CDATA[($F{SHIPCARTON_FREIGHTAMOUNT})- ($V{estimatedShipping})]]></variableExpression>
</variable>
<variable name="totalShipPriceDif" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$V{shipPriceDif}]]></variableExpression>
</variable>
<variable name="SOID_Count" class="java.lang.Integer" resetType="Group" resetGroup="SOID" calculation="Count">
<variableExpression><![CDATA[$F{SOITEM_SOID}]]></variableExpression>
</variable>
<variable name="estimatedShipping" class="java.lang.Double">
<variableExpression><![CDATA[$V{SOID_Count}<=1?$F{SOITEM_UNITPRICE}:0]]> </variableExpression>
</variable>
<group name="SOID">
<groupExpression><![CDATA[$F{SOITEM_SOID}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="27" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="25" uuid="64a1704a-b221-48a4-8186-1b855ead5acf"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="16" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{COMPANY_NAME}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="59" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="555" height="25" uuid="e20cae54-5d75-4e81-800c-55390d1ec465"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="14"/>
</textElement>
<text><![CDATA[Shipping Price Difference ]]></text>
</staticText>
<staticText>
<reportElement x="0" y="25" width="167" height="20" uuid="41be06d8-8fdf-4e3b-b526-1aea092ea734"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="14" isBold="false"/>
</textElement>
<text><![CDATA[Date Range:]]></text>
</staticText>
<staticText>
<reportElement x="267" y="25" width="20" height="20" uuid="a402544b-73b3-4132-8161-be4c202e9b14"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="14" isBold="false"/>
</textElement>
<text><![CDATA[-]]></text>
</staticText>
<textField>
<reportElement x="287" y="25" width="100" height="20" uuid="85e7fe2b-8149-4b18-8410-16b026cdb0f3"/>
<textElement verticalAlignment="Middle">
<font fontName="SansSerif" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{To}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="167" y="25" width="100" height="20" uuid="ea618bea-9201-4eba-abff-cfdc891ac76f"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{From}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="140" height="20" uuid="82883a63-752d-4265-8158-a5129b617b7d"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Customer Name]]></text>
</staticText>
<staticText>
<reportElement x="140" y="0" width="75" height="20" uuid="2d302854-c68c-4e5a-b94b-900c88937b9d"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[SO #]]></text>
</staticText>
<staticText>
<reportElement x="455" y="0" width="100" height="20" uuid="50c6ba0f-a5df-4aa3-8a47-282271055053"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Difference]]></text>
</staticText>
<line>
<reportElement x="0" y="19" width="555" height="1" uuid="be790d1c-d6d6-4169-b743-a98654c025e9"/>
</line>
<staticText>
<reportElement x="215" y="0" width="120" height="20" uuid="ffbe1333-86b8-435f-b914-46bb1c747683"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Estimated Shipping]]></text>
</staticText>
<staticText>
<reportElement x="335" y="0" width="120" height="20" uuid="3f683f6b-19f6-49dd-9ee1-787b216aaa2f"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Actual Shipping]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="140" height="20" isRemoveLineWhenBlank="true" uuid="fdd69c30-9da5-4bd2-a7b8-44a506e2d7ff"/>
<textFieldExpression><![CDATA[$F{CUSTOMER_NAME}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true" hyperlinkType="Reference">
<reportElement x="140" y="0" width="75" height="20" isRemoveLineWhenBlank="true" forecolor="#000099" uuid="19db6cb8-af37-46e6-9227-f1b55fc49f22"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{SO_NUM}]]></textFieldExpression>
<anchorNameExpression><![CDATA["SONum"]]></anchorNameExpression>
<hyperlinkReferenceExpression><![CDATA[$F{SO_NUM}]]></hyperlinkReferenceExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="335" y="0" width="120" height="20" isRemoveLineWhenBlank="true" uuid="006475e5-d36f-4482-97cf-2c2eda2d5a66"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{SHIPCARTON_FREIGHTAMOUNT}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="215" y="0" width="120" height="20" isRemoveLineWhenBlank="true" uuid="376d9c76-1d96-48ea-ac4a-40770ba28867"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{estimatedShipping}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
<reportElement x="455" y="0" width="100" height="20" isRemoveLineWhenBlank="true" uuid="c236c087-e6f4-4de6-a3d6-8abb8b798346"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{shipPriceDif}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="22" splitType="Stretch">
<textField>
<reportElement x="435" y="0" width="80" height="20" uuid="64e6c2aa-58eb-4994-83c3-16cb70197fef"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="515" y="0" width="40" height="20" uuid="09e2e08b-c9b1-4a5b-95fd-1c0a0dba17a2"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="22" splitType="Stretch">
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="150" y="1" width="75" height="20" uuid="8ab3526d-e89e-4043-86dd-52d89a2b7b21"/>
<textElement verticalAlignment="Top">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalShipPriceDif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="140" y="1" width="10" height="20" uuid="110043fb-4dde-414e-b07f-f79cbb8839ab"/>
<textElement textAlignment="Right">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[$]]></text>
</staticText>
<line>
<reportElement x="0" y="0" width="555" height="1" uuid="e81602ee-7eab-43f3-90c1-cf69086623a9"/>
</line>
<staticText>
<reportElement x="0" y="1" width="140" height="20" uuid="095559e8-33e4-4a1a-9537-f8dff2b533d6"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Total Cost Difference :]]></text>
</staticText>
</band>
</summary>
</jasperReport>
Your problem is that the $V{estimatedShipping} is evaluated after your variable $V{shipPriceDif} since its after in your variable definition, or move it above or dump it...
Just calculate the Difference in the textField
<textField pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
<reportElement x="455" y="0" width="100" height="20" isRemoveLineWhenBlank="true" uuid="c236c087-e6f4-4de6-a3d6-8abb8b798346"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{estimatedShipping}.doubleValue()-$F{SHIPCARTON_FREIGHTAMOUNT}.doubleValue()]]></textFieldExpression>
</textField>
The output of this would be:
+-------+-----------+--------+------------+
| SO# | Estimated | Actual | Difference |
+-------+-----------+--------+------------+
| 46137 | 700 | 58,38 | 641,62 |
| 46137 | 0 | 57,12 | -57.12 |
| 46137 | 0 | 28,29 | -28,29 |
| 46148 | 0,85 | 267,32 | -266,47 |
+-------+-----------+--------+------------+

Trying to get Jaspersoft Studio to Read Excel Numeric Values

I am using Jaspersoft Studio to create a JasperReports's report using an Excel file as data source (I have a couple of columns in excel with numeric values to which i have assigned the class java.lang.Number in fields). But when previewing the report, I get the following the error
"net.sf.jasperreports.engine.JRException: unable to get value for field 'Hours' of class java.lang.Number"
Any inputs please?
Here is my jrxml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 -->
<!-- 2014-09-25T18:35:44 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Leaf_Grey" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="896e484a-2240-4304-afcc-7290c150d8b7">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter (4)"/>
<style name="Title" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="Task" class="java.lang.String"/>
<field name="Site Name" class="java.lang.String"/>
<field name="Hours" class="java.lang.Number"/>
<field name="Minutes" class="java.lang.Number"/>
<field name="Status" class="java.lang.String"/>
<field name="Comments" class="java.lang.String"/>
<field name="Employee Name" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="70" splitType="Stretch">
<image>
<reportElement x="275" y="0" width="300" height="64" uuid="8636fef6-bee7-4ac4-9942-653e5c68326b"/>
<imageExpression><![CDATA["leaf_banner_gray.png"]]></imageExpression>
</image>
<staticText>
<reportElement style="Title" x="0" y="13" width="263" height="33" uuid="4370ee46-32ee-4993-8fc6-fff1a5cbbb10"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Leaf Gray Title]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="117" y="46" width="157" height="22" uuid="e0a627c7-e8b9-4efb-8e25-85fea9d9be9c"/>
<text><![CDATA[Leaf Gray SubTitle]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="36" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="35" width="555" height="1" uuid="8545dbd1-d876-4d96-8abf-d6b221e00a45"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
<staticText>
<reportElement style="Column header" x="0" y="19" width="79" height="15" uuid="cac2a980-c74e-44b0-b596-05d495272ccb"/>
<text><![CDATA[Task]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="79" y="19" width="79" height="15" uuid="d55bebe9-d167-4528-a78c-a5a41af89efc"/>
<text><![CDATA[Site Name]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="158" y="19" width="79" height="15" uuid="667ce640-c671-4337-8f0c-d23b3f4b273c"/>
<text><![CDATA[Hours]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="237" y="19" width="79" height="15" uuid="df472e1f-39fb-4b34-b0b3-0867407df860"/>
<text><![CDATA[Minutes]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="316" y="19" width="79" height="15" uuid="05e27ddd-a03c-4ad6-8596-5cfc00655de7"/>
<text><![CDATA[Status]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="395" y="19" width="79" height="15" uuid="cefa7fbe-75bd-4923-82a6-da21a13d4f58"/>
<text><![CDATA[Comments]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="474" y="19" width="79" height="15" uuid="090b77e6-6a38-43b4-8501-6e1c3e246764"/>
<text><![CDATA[Employee Name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="16" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="15" width="555" height="1" uuid="9b18ea63-f82d-4ef1-872e-8fde09656872"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
<textField>
<reportElement style="Detail" x="0" y="0" width="79" height="15" uuid="1f24eaab-1923-419e-9262-79b6c2b80499"/>
<textFieldExpression><![CDATA[$F{Task}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="79" y="0" width="79" height="15" uuid="f9b21e3a-3150-4744-a413-10cf734a2c3d"/>
<textFieldExpression><![CDATA[$F{Site Name}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="158" y="0" width="79" height="15" uuid="867d0368-9589-4c6b-8502-f71224a11a4c"/>
<textFieldExpression><![CDATA[$F{Hours}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="237" y="0" width="79" height="15" uuid="17715223-dbc6-462a-b80c-aeb54aa58932"/>
<textFieldExpression><![CDATA[$F{Minutes}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="316" y="0" width="79" height="15" uuid="3a3115d3-420d-4411-88cc-30b41f67443e"/>
<textFieldExpression><![CDATA[$F{Status}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="395" y="0" width="79" height="15" uuid="97194b34-07e1-49b4-aba0-af1efe7b9bf4"/>
<textFieldExpression><![CDATA[$F{Comments}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Detail" x="474" y="0" width="79" height="15" uuid="ba21b35b-74a9-45ee-862f-8752756350dd"/>
<textFieldExpression><![CDATA[$F{Employee Name}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1" uuid="7d65af8c-8abe-40ae-9953-98342530289f"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="20" splitType="Stretch">
<textField>
<reportElement style="Column header" x="433" y="0" width="80" height="20" uuid="afe06d42-bf57-40c1-9cbb-6e8a04a641e6"/>
<textElement textAlignment="Right">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement style="Column header" x="513" y="0" width="40" height="20" uuid="ee38e653-d5c9-4269-93a3-b1dcd2685d2c"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="0" y="0" width="197" height="20" uuid="af6b71ba-3c04-4b3c-9b70-e18e46b27ff4"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
And a sample excel file as follows:
Task Site Name Hours Minutes Status Comments Employee Name
Task A abc.com 3 45 Ongoing Easy Jim
Task B abc.com 1 20 Done Easy John
Task C abc.com 3 30 Ongoing Easy Jim
Task A abc.com 1 20 Done Easy John
Task D abc.com 3 45 Ongoing Easy Mary
Task A abc.com 1 20 Done Easy Stacy
Task E abc.com 3 30 Ongoing Easy Stacy
Task A abc.com 1 20 Done Easy Stacy
1) If the requirement is to change the Class to Number from String then, you need to click the checkbox "Use custom number pattern" and select a number pattern.
2) If there is no specific requirement, then its easy to select java.lang.Integer as the class for numbers. This will make the report work just fine.

How do I prevent a subreport from rendering over the top of other elements?

I have a master report that contains three sub-reports, named "vehicleListSubReport.jrxml", "locoSubreport.jrxml", and "crewSubreport.jrxml" Their datasources are the fields "vehicleReport", "locoReport" and "crewReport" respectively, which are all objects of type JRDataSource.
I am having a few problems, but I feel that they may have a single root cause, hence why I am asking about them all in the same question. Firstly, the code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="X2010" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="25640552-4299-40b4-8655-a64e83b16458">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="trainNumber" class="java.lang.String"/>
<field name="crewReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="trainType" class="java.lang.String"/>
<field name="origin" class="java.lang.String"/>
<field name="dangerousGoods" class="java.lang.Boolean">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="outOfGauge" class="java.lang.Boolean"/>
<field name="trainDate" class="java.util.Date"/>
<field name="approvedLength" class="java.lang.Integer"/>
<field name="destination" class="java.lang.String"/>
<field name="specialLoad" class="java.lang.Boolean"/>
<field name="submittedBy" class="java.lang.String"/>
<field name="phone" class="java.lang.String"/>
<field name="submittedAtDateTime" class="java.util.Date"/>
<field name="fax" class="java.lang.String"/>
<field name="numberOfVehicles" class="java.lang.Integer"/>
<field name="tonnesHauled" class="java.lang.String"/>
<field name="tonnesGross" class="java.lang.String"/>
<field name="totalLength" class="java.lang.Double"/>
<field name="locoReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="vehicleReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="railOperatorName" class="java.lang.String"/>
<field name="submitter" class="java.lang.String"/>
<field name="consistLocation" class="java.lang.String"/>
<group name="Group1">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression>
<groupFooter>
<band height="50" splitType="Stretch">
<printWhenExpression><![CDATA[$F{vehicleReport} != null]]></printWhenExpression>
</band>
</groupFooter>
</group>
<group name="Group2">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression>
<groupFooter>
<band height="107" splitType="Stretch"/>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="65" splitType="Stretch">
<staticText>
<reportElement style="Title" x="80" y="0" width="472" height="62" uuid="b89a83c9-c1a2-4ab6-85a2-88ba23795dd3"/>
<textElement verticalAlignment="Middle">
<font pdfFontName="Times-Roman"/>
</textElement>
<text><![CDATA[X20.10 Report]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="5" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="1" y="1" width="552" height="2" uuid="f93f01ef-7224-41b8-a330-380bec4336d6"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="400" splitType="Stretch">
<staticText>
<reportElement x="0" y="120" width="90" height="20" uuid="20c60332-1cff-4218-bfce-57cec3e447dd"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Number:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement isPrintRepeatedValues="false" x="-20" y="220" width="595" height="45" uuid="4f24664e-5df0-4326-9b95-9939f93c48d4"/>
<dataSourceExpression><![CDATA[$F{crewReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["crewSubreport.jasper"]]></subreportExpression>
</subreport>
<textField>
<reportElement x="90" y="120" width="90" height="20" uuid="110c9328-d33c-4c0a-86e5-7f4ebe669b4f"/>
<textFieldExpression><![CDATA[$F{trainNumber}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="90" width="554" height="30" uuid="efaedffc-7d27-40f0-acc1-71797d91472c"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Details]]></text>
</staticText>
<staticText>
<reportElement x="0" y="140" width="90" height="20" uuid="91493735-ab12-4068-9583-9edbbac7ca35"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Type:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="160" width="90" height="20" uuid="a3e483b0-59c4-494c-ad36-1ea30eb4c5f5"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Origin]]></text>
</staticText>
<staticText>
<reportElement x="0" y="180" width="90" height="20" uuid="f5f23f73-3bdb-4b12-b9ec-d1946d1d249c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Dangerous Goods:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="200" width="90" height="20" uuid="49aebc16-13db-4842-bb0f-23eac8f693a4"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Out of Gauge:]]></text>
</staticText>
<textField>
<reportElement x="90" y="140" width="90" height="20" uuid="ff7d87fc-1087-4edf-b1ed-454ff8ae94f8"/>
<textFieldExpression><![CDATA[$F{trainType}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="160" width="90" height="20" uuid="7f109b0f-f4f4-48af-9a13-909b766dbd3c"/>
<textFieldExpression><![CDATA[$F{origin}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="180" width="90" height="20" uuid="67f7fd28-1cee-402d-8a35-523058ab5061"/>
<textFieldExpression><![CDATA[$F{dangerousGoods} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="200" width="90" height="20" uuid="82586e0e-b6a7-43cf-9b1f-a12612396909"/>
<textFieldExpression><![CDATA[$F{outOfGauge} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="120" width="100" height="20" uuid="94651700-a070-400e-a206-fd09170cf797"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Date:]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="380" y="120" width="100" height="20" uuid="2ea29a18-1d85-4a23-b9f6-17459ceafe0d"/>
<textFieldExpression><![CDATA[$F{trainDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="140" width="100" height="20" uuid="3ffe5495-6b91-424b-b652-c48c72b39a8f"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Approved Length:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="160" width="100" height="20" uuid="68bcc4c2-d6c0-426b-979c-c70bbd1c550c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Destination:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="180" width="100" height="20" uuid="83e83257-d581-4fdd-8955-ef281357aaae"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Special Load:]]></text>
</staticText>
<textField>
<reportElement x="380" y="140" width="100" height="20" uuid="0f1b2cf0-73a3-4106-904a-8a28b7717909"/>
<textFieldExpression><![CDATA[$F{approvedLength}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="160" width="100" height="20" uuid="7a006853-a10a-4759-889f-b9848a59d79b"/>
<textFieldExpression><![CDATA[$F{destination}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="180" width="100" height="20" uuid="521136d0-a51f-4ca1-bdce-6d0ed1cd5c76"/>
<textFieldExpression><![CDATA[$F{specialLoad} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="50" width="90" height="20" uuid="36b52f46-6f49-4c75-88d0-27a221bc62ec"/>
<textFieldExpression><![CDATA[$F{submittedBy}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="50" width="90" height="20" uuid="2cad93ef-d94f-4479-93e7-7a232023dace"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted By:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="70" width="90" height="20" uuid="90474202-ce8b-4657-bad1-71edc8557335"/>
<text><![CDATA[Phone:]]></text>
</staticText>
<textField>
<reportElement x="90" y="70" width="90" height="20" uuid="20d6f136-62e4-4332-9098-3355896ff4af"/>
<textFieldExpression><![CDATA[$F{phone}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="380" y="50" width="174" height="20" uuid="540bcba3-93ee-4877-b5a8-6f58db7c7398"/>
<textFieldExpression><![CDATA[$F{submittedAtDateTime}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="50" width="100" height="20" uuid="957ce926-9636-4625-b91f-78ecd3b8a200"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted At:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="70" width="100" height="20" uuid="d8cf6e8b-9664-4012-b51d-6cdea49faf22"/>
<text><![CDATA[Fax:]]></text>
</staticText>
<textField>
<reportElement x="380" y="70" width="174" height="20" uuid="cc95ebda-f955-4eaf-9314-45e4a56c4fde"/>
<textFieldExpression><![CDATA[$F{fax}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="554" height="50" uuid="f7c297a9-e14e-44de-8769-5d483cfe4863"/>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Consist for " + $F{railOperatorName} + " submitted by " + $F{submitter} + "\nConsist Location: " + $F{consistLocation}]]></textFieldExpression>
</textField>
<subreport runToBottom="true">
<reportElement stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="50" y="330" width="130" height="20" uuid="4f470a33-ef93-425d-951e-e53642df7771"/>
<dataSourceExpression><![CDATA[$F{locoReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["locoSubreport.jasper"]]></subreportExpression>
</subreport>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="460" y="310" width="80" height="20" uuid="f182c7db-f00f-4107-bc33-93b30faf11a9"/>
<textFieldExpression><![CDATA[$F{totalLength}]]></textFieldExpression>
</textField>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="280" y="310" width="80" height="20" uuid="c5f34099-ac0e-4634-9398-a96f93c052f6"/>
<textFieldExpression><![CDATA[$F{tonnesHauled}]]></textFieldExpression>
</textField>
<staticText>
<reportElement isPrintRepeatedValues="false" x="190" y="330" width="80" height="20" uuid="824478e7-fc00-4d16-8a39-6355baf4bc61"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Gross:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="190" y="310" width="80" height="20" uuid="e0bc266a-56f2-4246-bea6-f31c4718046d"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Hauled:]]></text>
</staticText>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="280" y="330" width="80" height="20" uuid="74e9ef61-e6e0-45fa-9966-9950c2f5a1e0"/>
<textFieldExpression><![CDATA[$F{tonnesGross}]]></textFieldExpression>
</textField>
<textField>
<reportElement isPrintRepeatedValues="false" x="100" y="310" width="80" height="20" uuid="86833b59-3fe2-4c50-8d8e-18d80e082f75"/>
<textFieldExpression><![CDATA[$F{numberOfVehicles}]]></textFieldExpression>
</textField>
<staticText>
<reportElement isPrintRepeatedValues="false" x="0" y="330" width="40" height="20" uuid="c08f0b3c-0ddf-4cbb-b377-1f48b80fa383"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Locos:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="0" y="310" width="90" height="20" uuid="6a4a5d4b-5762-45d2-b54f-2167af8da5f8"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Number Vehicles:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="1" y="270" width="551" height="35" uuid="53e5c946-8e6d-44fa-8715-f193d224b489"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Summary]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="370" y="310" width="80" height="20" uuid="31012f66-602d-4892-82f4-d1187915046e"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Length:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="-20" y="360" width="595" height="20" printWhenGroupChanges="Group1" uuid="8e2dbcb5-3c3f-4bb5-a606-39f6f2e8656a"/>
<dataSourceExpression><![CDATA[$F{vehicleReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["vehicleListSubreport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="6" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="0" width="554" height="2" uuid="447d20b2-f65e-42ee-b2a8-69632882c668"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="-21" y="1" width="597" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="24b6cb4b-7cad-4abd-a159-cc5cc11896db"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="533" y="0" width="40" height="20" forecolor="#736343" uuid="5463547b-d0a6-440d-baa9-9b1dcce760bf"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="453" y="0" width="80" height="20" forecolor="#736343" uuid="17310c63-a8e1-4f36-aad6-1b37346d27f6"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="22" y="1" width="197" height="20" forecolor="#736343" uuid="340aeee4-0582-45c2-9fbf-f1250cba3f8a"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
First problem: The crewSubreport has other report elements below it, including the other two sub-reports. If there are multiple records in this sub-report, it renders on top of the elements below it, including the other sub-reports.
Second problem: The data text fields below the crewSubreport are rendering (although with the subreport rendering on top of them), however, the static text boxes with the labels "Train Summary", "Number Vehicles:", "Tonnes Hauled:", "Total Length:", "Locos:", and "Tonnes Gross:" are not rendering, and I not yet able to determine why.
Third problem: Similar to the first problem, the locoSubreport is rendering into the space occupied by the vehicleListSubreport.
How do I fix these issues?
EDIT: Posting the following to illustrate the issues I'm having with the only answer so far:
In the memory usage and CPU usage graphs, the small peaks on the left are me running the report I designed. The rest of the graph after that is what happens when I run the report designed in the answer. It continues like this until the garbage collector seems to give up and kills the thread. Generating this report is the only thing the program is doing at this time. Using the VisualVM to force the JVM to perform a full garbage collection does not reclaim any memory. It would appear to me that there is a problem in Jasper Reports when using positionType="Float", and I need a solution that does not trigger this problem.
Try this code (everything belove first sub report is in a frame so it might be less cpu intensive to move them all together):
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="X2010" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="25640552-4299-40b4-8655-a64e83b16458">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="trainNumber" class="java.lang.String"/>
<field name="crewReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="trainType" class="java.lang.String"/>
<field name="origin" class="java.lang.String"/>
<field name="dangerousGoods" class="java.lang.Boolean">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="outOfGauge" class="java.lang.Boolean"/>
<field name="trainDate" class="java.util.Date"/>
<field name="approvedLength" class="java.lang.Integer"/>
<field name="destination" class="java.lang.String"/>
<field name="specialLoad" class="java.lang.Boolean"/>
<field name="submittedBy" class="java.lang.String"/>
<field name="phone" class="java.lang.String"/>
<field name="submittedAtDateTime" class="java.util.Date"/>
<field name="fax" class="java.lang.String"/>
<field name="numberOfVehicles" class="java.lang.Integer"/>
<field name="tonnesHauled" class="java.lang.String"/>
<field name="tonnesGross" class="java.lang.String"/>
<field name="totalLength" class="java.lang.Double"/>
<field name="locoReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="vehicleReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="railOperatorName" class="java.lang.String"/>
<field name="submitter" class="java.lang.String"/>
<field name="consistLocation" class="java.lang.String"/>
<group name="Group1">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression>
<groupFooter>
<band height="50" splitType="Stretch">
<printWhenExpression><![CDATA[$F{vehicleReport} != null]]></printWhenExpression>
</band>
</groupFooter>
</group>
<group name="Group2">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression>
<groupFooter>
<band height="107" splitType="Stretch"/>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="65" splitType="Stretch">
<staticText>
<reportElement style="Title" x="80" y="0" width="472" height="62" uuid="b89a83c9-c1a2-4ab6-85a2-88ba23795dd3"/>
<textElement verticalAlignment="Middle">
<font pdfFontName="Times-Roman"/>
</textElement>
<text><![CDATA[X20.10 Report]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="5" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="1" y="1" width="552" height="2" uuid="f93f01ef-7224-41b8-a330-380bec4336d6"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="400" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="0" y="120" width="90" height="20" uuid="20c60332-1cff-4218-bfce-57cec3e447dd"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Number:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement isPrintRepeatedValues="false" x="-20" y="220" width="595" height="45" uuid="4f24664e-5df0-4326-9b95-9939f93c48d4"/>
<dataSourceExpression><![CDATA[$F{crewReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["crewSubreport.jasper"]]></subreportExpression>
</subreport>
<textField>
<reportElement x="90" y="120" width="90" height="20" uuid="110c9328-d33c-4c0a-86e5-7f4ebe669b4f"/>
<textFieldExpression><![CDATA[$F{trainNumber}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="90" width="554" height="30" uuid="efaedffc-7d27-40f0-acc1-71797d91472c"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Details]]></text>
</staticText>
<staticText>
<reportElement x="0" y="140" width="90" height="20" uuid="91493735-ab12-4068-9583-9edbbac7ca35"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Type:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="160" width="90" height="20" uuid="a3e483b0-59c4-494c-ad36-1ea30eb4c5f5"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Origin]]></text>
</staticText>
<staticText>
<reportElement x="0" y="180" width="90" height="20" uuid="f5f23f73-3bdb-4b12-b9ec-d1946d1d249c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Dangerous Goods:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="200" width="90" height="20" uuid="49aebc16-13db-4842-bb0f-23eac8f693a4"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Out of Gauge:]]></text>
</staticText>
<textField>
<reportElement x="90" y="140" width="90" height="20" uuid="ff7d87fc-1087-4edf-b1ed-454ff8ae94f8"/>
<textFieldExpression><![CDATA[$F{trainType}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="160" width="90" height="20" uuid="7f109b0f-f4f4-48af-9a13-909b766dbd3c"/>
<textFieldExpression><![CDATA[$F{origin}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="180" width="90" height="20" uuid="67f7fd28-1cee-402d-8a35-523058ab5061"/>
<textFieldExpression><![CDATA[$F{dangerousGoods} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="200" width="90" height="20" uuid="82586e0e-b6a7-43cf-9b1f-a12612396909"/>
<textFieldExpression><![CDATA[$F{outOfGauge} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="120" width="100" height="20" uuid="94651700-a070-400e-a206-fd09170cf797"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Date:]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="380" y="120" width="100" height="20" uuid="2ea29a18-1d85-4a23-b9f6-17459ceafe0d"/>
<textFieldExpression><![CDATA[$F{trainDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="140" width="100" height="20" uuid="3ffe5495-6b91-424b-b652-c48c72b39a8f"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Approved Length:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="160" width="100" height="20" uuid="68bcc4c2-d6c0-426b-979c-c70bbd1c550c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Destination:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="180" width="100" height="20" uuid="83e83257-d581-4fdd-8955-ef281357aaae"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Special Load:]]></text>
</staticText>
<textField>
<reportElement x="380" y="140" width="100" height="20" uuid="0f1b2cf0-73a3-4106-904a-8a28b7717909"/>
<textFieldExpression><![CDATA[$F{approvedLength}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="160" width="100" height="20" uuid="7a006853-a10a-4759-889f-b9848a59d79b"/>
<textFieldExpression><![CDATA[$F{destination}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="180" width="100" height="20" uuid="521136d0-a51f-4ca1-bdce-6d0ed1cd5c76"/>
<textFieldExpression><![CDATA[$F{specialLoad} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="50" width="90" height="20" uuid="36b52f46-6f49-4c75-88d0-27a221bc62ec"/>
<textFieldExpression><![CDATA[$F{submittedBy}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="50" width="90" height="20" uuid="2cad93ef-d94f-4479-93e7-7a232023dace"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted By:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="70" width="90" height="20" uuid="90474202-ce8b-4657-bad1-71edc8557335"/>
<text><![CDATA[Phone:]]></text>
</staticText>
<textField>
<reportElement x="90" y="70" width="90" height="20" uuid="20d6f136-62e4-4332-9098-3355896ff4af"/>
<textFieldExpression><![CDATA[$F{phone}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="380" y="50" width="174" height="20" uuid="540bcba3-93ee-4877-b5a8-6f58db7c7398"/>
<textFieldExpression><![CDATA[$F{submittedAtDateTime}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="50" width="100" height="20" uuid="957ce926-9636-4625-b91f-78ecd3b8a200"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted At:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="70" width="100" height="20" uuid="d8cf6e8b-9664-4012-b51d-6cdea49faf22"/>
<text><![CDATA[Fax:]]></text>
</staticText>
<textField>
<reportElement x="380" y="70" width="174" height="20" uuid="cc95ebda-f955-4eaf-9314-45e4a56c4fde"/>
<textFieldExpression><![CDATA[$F{fax}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="554" height="50" uuid="f7c297a9-e14e-44de-8769-5d483cfe4863"/>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Consist for " + $F{railOperatorName} + " submitted by " + $F{submitter} + "\nConsist Location: " + $F{consistLocation}]]></textFieldExpression>
</textField>
<frame>
<reportElement positionType="Float" x="-20" y="270" width="596" height="110" uuid="18015311-a28e-4eee-9051-45b1790d24f7">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreport runToBottom="true">
<reportElement stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="50" y="60" width="130" height="20" uuid="4f470a33-ef93-425d-951e-e53642df7771">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[$F{locoReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["locoSubreport.jasper"]]></subreportExpression>
</subreport>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="460" y="40" width="80" height="20" uuid="f182c7db-f00f-4107-bc33-93b30faf11a9">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{totalLength}]]></textFieldExpression>
</textField>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="280" y="40" width="80" height="20" uuid="c5f34099-ac0e-4634-9398-a96f93c052f6">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{tonnesHauled}]]></textFieldExpression>
</textField>
<staticText>
<reportElement isPrintRepeatedValues="false" x="190" y="60" width="80" height="20" uuid="824478e7-fc00-4d16-8a39-6355baf4bc61">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Gross:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="190" y="40" width="80" height="20" uuid="e0bc266a-56f2-4246-bea6-f31c4718046d">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Hauled:]]></text>
</staticText>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement isPrintRepeatedValues="false" x="280" y="60" width="80" height="20" uuid="74e9ef61-e6e0-45fa-9966-9950c2f5a1e0">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{tonnesGross}]]></textFieldExpression>
</textField>
<textField>
<reportElement isPrintRepeatedValues="false" x="100" y="40" width="80" height="20" uuid="86833b59-3fe2-4c50-8d8e-18d80e082f75">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{numberOfVehicles}]]></textFieldExpression>
</textField>
<staticText>
<reportElement isPrintRepeatedValues="false" x="0" y="60" width="40" height="20" uuid="c08f0b3c-0ddf-4cbb-b377-1f48b80fa383">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Locos:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="0" y="40" width="90" height="20" uuid="6a4a5d4b-5762-45d2-b54f-2167af8da5f8">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Number Vehicles:]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="1" y="0" width="551" height="35" uuid="53e5c946-8e6d-44fa-8715-f193d224b489">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Summary]]></text>
</staticText>
<staticText>
<reportElement isPrintRepeatedValues="false" x="370" y="40" width="80" height="20" uuid="31012f66-602d-4892-82f4-d1187915046e">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Length:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="90" width="595" height="20" printWhenGroupChanges="Group1" uuid="8e2dbcb5-3c3f-4bb5-a606-39f6f2e8656a">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[$F{vehicleReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["vehicleListSubreport.jasper"]]></subreportExpression>
</subreport>
</frame>
</band>
</detail>
<columnFooter>
<band height="6" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="0" width="554" height="2" uuid="447d20b2-f65e-42ee-b2a8-69632882c668"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="-21" y="1" width="597" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="24b6cb4b-7cad-4abd-a159-cc5cc11896db"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="533" y="0" width="40" height="20" forecolor="#736343" uuid="5463547b-d0a6-440d-baa9-9b1dcce760bf"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="453" y="0" width="80" height="20" forecolor="#736343" uuid="17310c63-a8e1-4f36-aad6-1b37346d27f6"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="22" y="1" width="197" height="20" forecolor="#736343" uuid="340aeee4-0582-45c2-9fbf-f1250cba3f8a"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
Try this code.
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="X2010" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="25640552-4299-40b4-8655-a64e83b16458">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="trainNumber" class="java.lang.String"/>
<field name="crewReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="trainType" class="java.lang.String"/>
<field name="origin" class="java.lang.String"/>
<field name="dangerousGoods" class="java.lang.Boolean">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="outOfGauge" class="java.lang.Boolean"/>
<field name="trainDate" class="java.util.Date"/>
<field name="approvedLength" class="java.lang.Integer"/>
<field name="destination" class="java.lang.String"/>
<field name="specialLoad" class="java.lang.Boolean"/>
<field name="submittedBy" class="java.lang.String"/>
<field name="phone" class="java.lang.String"/>
<field name="submittedAtDateTime" class="java.util.Date"/>
<field name="fax" class="java.lang.String"/>
<field name="numberOfVehicles" class="java.lang.Integer"/>
<field name="tonnesHauled" class="java.lang.String"/>
<field name="tonnesGross" class="java.lang.String"/>
<field name="totalLength" class="java.lang.Double"/>
<field name="locoReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="vehicleReport" class="net.sf.jasperreports.engine.JRDataSource"/>
<field name="railOperatorName" class="java.lang.String"/>
<field name="submitter" class="java.lang.String"/>
<field name="consistLocation" class="java.lang.String"/>
<group name="Group1">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression>
<groupFooter>
<band height="50" splitType="Stretch">
<printWhenExpression><![CDATA[$F{vehicleReport} != null]]></printWhenExpression>
</band>
</groupFooter>
</group>
<group name="Group2">
<groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression>
<groupFooter>
<band height="107" splitType="Stretch"/>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="65" splitType="Stretch">
<staticText>
<reportElement style="Title" x="80" y="0" width="472" height="62" uuid="b89a83c9-c1a2-4ab6-85a2-88ba23795dd3"/>
<textElement verticalAlignment="Middle">
<font pdfFontName="Times-Roman"/>
</textElement>
<text><![CDATA[X20.10 Report]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="5" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="1" y="1" width="552" height="2" uuid="f93f01ef-7224-41b8-a330-380bec4336d6"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="400" splitType="Stretch">
<staticText>
<reportElement x="0" y="120" width="90" height="20" uuid="20c60332-1cff-4218-bfce-57cec3e447dd"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Number:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement isPrintRepeatedValues="false" x="-20" y="220" width="595" height="45" uuid="4f24664e-5df0-4326-9b95-9939f93c48d4"/>
<dataSourceExpression><![CDATA[$F{crewReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["crewSubreport.jasper"]]></subreportExpression>
</subreport>
<textField>
<reportElement x="90" y="120" width="90" height="20" uuid="110c9328-d33c-4c0a-86e5-7f4ebe669b4f"/>
<textFieldExpression><![CDATA[$F{trainNumber}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="90" width="554" height="30" uuid="efaedffc-7d27-40f0-acc1-71797d91472c"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Details]]></text>
</staticText>
<staticText>
<reportElement x="0" y="140" width="90" height="20" uuid="91493735-ab12-4068-9583-9edbbac7ca35"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Type:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="160" width="90" height="20" uuid="a3e483b0-59c4-494c-ad36-1ea30eb4c5f5"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Origin]]></text>
</staticText>
<staticText>
<reportElement x="0" y="180" width="90" height="20" uuid="f5f23f73-3bdb-4b12-b9ec-d1946d1d249c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Dangerous Goods:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="200" width="90" height="20" uuid="49aebc16-13db-4842-bb0f-23eac8f693a4"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Out of Gauge:]]></text>
</staticText>
<textField>
<reportElement x="90" y="140" width="90" height="20" uuid="ff7d87fc-1087-4edf-b1ed-454ff8ae94f8"/>
<textFieldExpression><![CDATA[$F{trainType}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="160" width="90" height="20" uuid="7f109b0f-f4f4-48af-9a13-909b766dbd3c"/>
<textFieldExpression><![CDATA[$F{origin}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="180" width="90" height="20" uuid="67f7fd28-1cee-402d-8a35-523058ab5061"/>
<textFieldExpression><![CDATA[$F{dangerousGoods} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="200" width="90" height="20" uuid="82586e0e-b6a7-43cf-9b1f-a12612396909"/>
<textFieldExpression><![CDATA[$F{outOfGauge} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="120" width="100" height="20" uuid="94651700-a070-400e-a206-fd09170cf797"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Train Date:]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="380" y="120" width="100" height="20" uuid="2ea29a18-1d85-4a23-b9f6-17459ceafe0d"/>
<textFieldExpression><![CDATA[$F{trainDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="140" width="100" height="20" uuid="3ffe5495-6b91-424b-b652-c48c72b39a8f"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Approved Length:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="160" width="100" height="20" uuid="68bcc4c2-d6c0-426b-979c-c70bbd1c550c"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Destination:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="180" width="100" height="20" uuid="83e83257-d581-4fdd-8955-ef281357aaae"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Special Load:]]></text>
</staticText>
<textField>
<reportElement x="380" y="140" width="100" height="20" uuid="0f1b2cf0-73a3-4106-904a-8a28b7717909"/>
<textFieldExpression><![CDATA[$F{approvedLength}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="160" width="100" height="20" uuid="7a006853-a10a-4759-889f-b9848a59d79b"/>
<textFieldExpression><![CDATA[$F{destination}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="380" y="180" width="100" height="20" uuid="521136d0-a51f-4ca1-bdce-6d0ed1cd5c76"/>
<textFieldExpression><![CDATA[$F{specialLoad} ? "Yes" : "No"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="50" width="90" height="20" uuid="36b52f46-6f49-4c75-88d0-27a221bc62ec"/>
<textFieldExpression><![CDATA[$F{submittedBy}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="50" width="90" height="20" uuid="2cad93ef-d94f-4479-93e7-7a232023dace"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted By:]]></text>
</staticText>
<staticText>
<reportElement x="0" y="70" width="90" height="20" uuid="90474202-ce8b-4657-bad1-71edc8557335"/>
<text><![CDATA[Phone:]]></text>
</staticText>
<textField>
<reportElement x="90" y="70" width="90" height="20" uuid="20d6f136-62e4-4332-9098-3355896ff4af"/>
<textFieldExpression><![CDATA[$F{phone}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="380" y="50" width="174" height="20" uuid="540bcba3-93ee-4877-b5a8-6f58db7c7398"/>
<textFieldExpression><![CDATA[$F{submittedAtDateTime}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="280" y="50" width="100" height="20" uuid="957ce926-9636-4625-b91f-78ecd3b8a200"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Submitted At:]]></text>
</staticText>
<staticText>
<reportElement x="280" y="70" width="100" height="20" uuid="d8cf6e8b-9664-4012-b51d-6cdea49faf22"/>
<text><![CDATA[Fax:]]></text>
</staticText>
<textField>
<reportElement x="380" y="70" width="174" height="20" uuid="cc95ebda-f955-4eaf-9314-45e4a56c4fde"/>
<textFieldExpression><![CDATA[$F{fax}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="554" height="50" uuid="f7c297a9-e14e-44de-8769-5d483cfe4863"/>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Consist for " + $F{railOperatorName} + " submitted by " + $F{submitter} + "\nConsist Location: " + $F{consistLocation}]]></textFieldExpression>
</textField>
<subreport runToBottom="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="50" y="330" width="130" height="20" uuid="4f470a33-ef93-425d-951e-e53642df7771"/>
<dataSourceExpression><![CDATA[$F{locoReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["locoSubreport.jasper"]]></subreportExpression>
</subreport>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="460" y="310" width="80" height="20" uuid="f182c7db-f00f-4107-bc33-93b30faf11a9"/>
<textFieldExpression><![CDATA[$F{totalLength}]]></textFieldExpression>
</textField>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="280" y="310" width="80" height="20" uuid="c5f34099-ac0e-4634-9398-a96f93c052f6"/>
<textFieldExpression><![CDATA[$F{tonnesHauled}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="190" y="330" width="80" height="20" uuid="824478e7-fc00-4d16-8a39-6355baf4bc61"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Gross:]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="190" y="310" width="80" height="20" uuid="e0bc266a-56f2-4246-bea6-f31c4718046d"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Tonnes Hauled:]]></text>
</staticText>
<textField pattern="#0.00#;(#0.00#-)">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="280" y="330" width="80" height="20" uuid="74e9ef61-e6e0-45fa-9966-9950c2f5a1e0"/>
<textFieldExpression><![CDATA[$F{tonnesGross}]]></textFieldExpression>
</textField>
<textField>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="100" y="310" width="80" height="20" uuid="86833b59-3fe2-4c50-8d8e-18d80e082f75"/>
<textFieldExpression><![CDATA[$F{numberOfVehicles}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="330" width="40" height="20" uuid="c08f0b3c-0ddf-4cbb-b377-1f48b80fa383"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Locos:]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="310" width="90" height="20" uuid="6a4a5d4b-5762-45d2-b54f-2167af8da5f8"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Number Vehicles:]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="1" y="270" width="551" height="35" uuid="53e5c946-8e6d-44fa-8715-f193d224b489"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font size="18"/>
</textElement>
<text><![CDATA[Train Summary]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" isPrintRepeatedValues="false" x="370" y="310" width="80" height="20" uuid="31012f66-602d-4892-82f4-d1187915046e"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Length:]]></text>
</staticText>
<subreport runToBottom="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="-20" y="360" width="595" height="20" printWhenGroupChanges="Group1" uuid="8e2dbcb5-3c3f-4bb5-a606-39f6f2e8656a"/>
<dataSourceExpression><![CDATA[$F{vehicleReport}]]></dataSourceExpression>
<subreportExpression><![CDATA["vehicleListSubreport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="6" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="0" width="554" height="2" uuid="447d20b2-f65e-42ee-b2a8-69632882c668"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="-21" y="1" width="597" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="24b6cb4b-7cad-4abd-a159-cc5cc11896db"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="533" y="0" width="40" height="20" forecolor="#736343" uuid="5463547b-d0a6-440d-baa9-9b1dcce760bf"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="453" y="0" width="80" height="20" forecolor="#736343" uuid="17310c63-a8e1-4f36-aad6-1b37346d27f6"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="22" y="1" width="197" height="20" forecolor="#736343" uuid="340aeee4-0582-45c2-9fbf-f1250cba3f8a"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>

JasperReports: Subreport renders multiple times, causing duplicate pages

I am using JasperReports to generate a graph and table for a web application using two separate queries. My main JRXML generates the graph, and I include a subreport in the Detail band to generate the table. However, when it renders, the subreport seems to get rendered multiple times (12 to be exact), which results in the generated report being the same graph and table on 12 pages (exact duplicates of each other). This happens both through the online application and iReport.
My main JRXML, subreport JRXML, and report generation code are below (some details have been removed for NDA reasons).
Any insight or ideas on what the issue is would be very helpful.
Main JRXML:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["<<PATH_TO_SUBREPORT>>"]]></defaultValueExpression>
</parameter>
<parameter name="param" class="java.util.Collection" />
<queryString language="SQL">
<![CDATA[<<DATABASE_QUERY>>]]>
</queryString>
<field name="FIELD1" class="java.lang.Integer"/>
<field name="FIELD2" class="java.sql.Date"/>
<field name="FIELD3" class="java.math.BigDecimal"/>
<field name="FIELD4" class="java.math.BigDecimal"/>
<field name="FIELD5" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="10" splitType="Stretch"/>
</title>
<pageHeader>
<band height="5" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="5" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="513" splitType="Stretch">
<lineChart>
<chart>
<reportElement positionType="Float" x="51" y="0" width="680" height="400"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<categoryDataset>
<categorySeries>
<seriesExpression><![CDATA["FIELD1"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["FIELD2"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["FIELD3"]]></seriesExpression>
<categoryExpression><![CDATA[$F{f1}]]></categoryExpression>
<valueExpression><![CDATA[$F{f2}]]></valueExpression>
</categorySeries>
</categoryDataset>
<linePlot>
<plot labelRotation="-90.0"/>
<categoryAxisFormat labelRotation="-90.0">
<axisFormat>
<tickLabelFont>
<font size="12"/>
</tickLabelFont>
</axisFormat>
</categoryAxisFormat>
<rangeAxisMinValueExpression><![CDATA[0]]></rangeAxisMinValueExpression>
<rangeAxisMaxValueExpression><![CDATA[101]]></rangeAxisMaxValueExpression>
</linePlot>
</lineChart>
<subreport>
<reportElement x="377" y="413" width="425" height="100"/>
<subreportParameter name="param">
<subreportParameterExpression><![CDATA[$P{param}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "testReport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="5" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="15" splitType="Stretch">
<textField>
<reportElement mode="Opaque" x="3" y="2" width="759" height="13" backcolor="#E6E6E6"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement mode="Opaque" x="762" y="2" width="40" height="13" backcolor="#E6E6E6"/>
<textElement/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="3" y="0" width="100" height="13"/>
<textElement/>
<textFieldExpression><![CDATA[new SimpleDateFormat("MM-dd-yyyy").format(
new java.util.Date())]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="10" splitType="Stretch"/>
</summary>
</jasperReport>
Sub Report JRXML:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="evcas_sub" language="groovy" pageWidth="450" pageHeight="150" columnWidth="10" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#0000FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFBFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
<style backcolor="#EFEFFF"/>
</conditionalStyle>
</style>
<style name="Crosstab Data Text" hAlign="Center"/>
<parameter name="param" class="java.util.Collection" />
<queryString>
<![CDATA[<<DATABASE_QUERY>>]]>
</queryString>
<field name="FIELD1" class="java.lang.String"/>
<field name="FIELD2" class="java.math.BigDecimal"/>
<field name="FIELD3" class="java.math.BigDecimal"/>
<field name="FIELD4" class="java.math.BigDecimal"/>
<field name="FIELD5" class="java.math.BigDecimal"/>
<field name="FIELD6" class="java.math.BigDecimal"/>
<field name="FIELD7" class="java.math.BigDecimal"/>
<field name="FIELD8" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="5" splitType="Stretch"/>
</title>
<pageHeader>
<band height="5"/>
</pageHeader>
<columnHeader>
<band height="12">
<textField>
<reportElement style="table_TH" x="0" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD1"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="50" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD2"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="100" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD3"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="150" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD4"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="200" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD5"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="250" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD6"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="300" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD7"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_TH" x="350" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="9"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA["FIELD8"]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="12">
<textField>
<reportElement style="table_CH" x="0" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f1}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="50" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f2}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="100" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f3}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="150" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f4}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="200" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f5}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="250" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f6}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="300" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f7}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="table_CH" x="350" y="0" width="50" height="12" backcolor="#FFFFFF"/>
<textElement>
<font size="8"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{f8}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="5" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="5" splitType="Stretch"/>
</pageFooter>
</jasperReport>
Rendering Code:
String strFileName = "<<FILENAME>>";
File jrxml = new File(strFileName);
InputStream iStream = new FileInputStream(jrxml);
JasperReport objJReport = JasperCompileManager.compileReport(iStream);
JasperPrint objJPrint = JasperFillManager.fillReport(objJReport, hashMap, datasource.getConnection());
JasperExportManager.exportReportToPdfStream(objJPrint, os);
One detail band is printed per record in your data set. So if your database query returns 12 rows, you get 12 copies of the detail band. Each band uses data from a single row, but this is inconsequential for you as you are using a chart and subreport to display the data.
To avoid this repetition, just put your chart and subreport into a different band. I'd go for column header or footer, but anything except detail will work.