I have a requirement where I need to display a section of data surrounded by borders, like this:
I have tried to do it with adding Rectangle component in the Background band. In the internal preview window and PDF preview it is displayed as above, but when I run it in the server or use HTML preview, the border disappears. I have also tried to insert the Rectangle component in the Detail band and using Frames instead of a Rectangle, surrounding the data, but with the same problem.
I am using iReport 5.0.1 with compatibility set to JasperReports 3.5.1.
Here is my jrxml file:
<?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="Payslip" pageWidth="1000" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<import value="org.joda.time.DateTime"/>
<style name="Headings" vAlign="Middle" lineSpacing="1_1_2" fontName="Arial" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="Data" isDefault="true" vAlign="Middle" lineSpacing="1_1_2" fontName="Arial" fontSize="11"/>
<parameter name="rptName" class="java.lang.String" isForPrompting="false"/>
<parameter name="company" class="java.lang.String"/>
<field name="empName" class="java.lang.String"/>
<field name="salaryMonthName" class="java.lang.String"/>
<field name="salaryMonthYear" class="java.lang.Integer"/>
<field name="employeeCode" class="java.lang.String"/>
<field name="designation" class="java.lang.String"/>
<field name="grade" class="java.lang.String"/>
<field name="location" class="java.lang.String"/>
<field name="department" class="java.lang.String"/>
<field name="branch" class="java.lang.String"/>
<field name="dateOfJoining" class="org.joda.time.DateTime"/>
<field name="pfNumber" class="java.lang.String"/>
<field name="panNumber" class="java.lang.String"/>
<field name="bankName" class="java.lang.String"/>
<field name="accountNumber" class="java.lang.String"/>
<field name="workingDays" class="java.lang.Double"/>
<field name="paidDays" class="java.lang.Double"/>
<field name="absentDays" class="java.lang.Double"/>
<background>
<band height="301">
<rectangle>
<reportElement mode="Transparent" x="0" y="120" width="324" height="165"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="324" y="120" width="320" height="165"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
</band>
</background>
<title>
<band height="102">
<line>
<reportElement x="0" y="43" width="265" height="1" forecolor="#3333FF"/>
<graphicElement>
<pen lineWidth="3.0"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="405" height="32" forecolor="#3333FF"/>
<textElement lineSpacing="Single">
<font size="16" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{company}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="44" width="200" height="31" forecolor="#3333FF"/>
<textElement lineSpacing="Single">
<font fontName="Arial" size="18"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{rptName}]]></textFieldExpression>
</textField>
<textField pattern="EEE, d MMM yyyy HH:mm">
<reportElement mode="Opaque" x="843" y="71" width="117" height="20" forecolor="#FFFFFF" backcolor="#999999"/>
<textElement lineSpacing="Single">
<font fontName="Arial"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="92" y="82" width="129" height="20"/>
<textElement lineSpacing="Single">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{salaryMonthName} + " " + $F{salaryMonthYear}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="82" width="92" height="20"/>
<textElement lineSpacing="Single">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[For Month]]></text>
</staticText>
</band>
</title>
<detail>
<band height="205">
<staticText>
<reportElement style="Headings" x="12" y="23" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Code]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="43" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Name]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="63" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Designation]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="83" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Grade]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="103" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Location]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="123" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Department]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="143" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Branch]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="163" width="92" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Date of Joining]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="23" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[P. F. Number]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="43" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[PAN No.]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="63" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Pay Mode / Bank Name]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="83" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[A/C No.]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="103" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Working Days]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="123" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Paid Days]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="143" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Absent Days]]></text>
</staticText>
<textField>
<reportElement x="154" y="23" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{employeeCode}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="43" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{empName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="63" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{designation}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="83" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{grade}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="103" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{location}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="123" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{department}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="143" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{branch}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="23" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{pfNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="43" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{panNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="63" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{bankName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="83" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{accountNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="103" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{workingDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="123" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{paidDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="143" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{absentDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="163" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{dateOfJoining}.toString("dd-MMM-yyyy")]]></textFieldExpression>
</textField>
<break>
<reportElement x="0" y="184" width="960" height="1"/>
</break>
</band>
</detail>
</jasperReport>
The problem that you are having may be due to the fact that you cannot have objects overlapping in HTML. I have had this issue with Jasper before. If two objects (or more) overlap, only one of them will show on the report.
You could try using separate lines that do not overlap any of the other objects.
I have had trouble getting that to work so the way I have dealt with the situation in cases like yours is to use the borders of the text fields to make up the rectangles. For the top left label (Code), you can use it's top and left borders. For the middle labels, the left border. And for the bottom field (Date of Joining), the bottom and left borders. Then the opposite for the text fields. Then you can use padding on your text fields to make them look right. Sometimes I have a padding of 20 or more to get the effect I'm looking for.
I hope this helps.
Related
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
This is my code for Grandtotal but it won't have grandtotal ?
<?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="Warehouse" language="groovy" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<queryString language="SQL">
<![CDATA[select * from warehouse]]>
</queryString>
<field name="PlantUnit" class="java.lang.String"/>
<field name="Description" class="java.lang.String"/>
<field name="Size" class="java.lang.String"/>
<field name="Qty" class="java.lang.String"/>
<field name="Unit" class="java.lang.String"/>
<field name="Unit Price" class="java.lang.String"/>
<field name="Amount" class="java.lang.String"/>
<variable name="TotalAmount" class="java.lang.String" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="40" splitType="Stretch">
<staticText>
<reportElement x="100" y="0" width="409" height="40"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="34" isBold="true"/>
</textElement>
<text><![CDATA[WAREHOUSE]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="15" splitType="Stretch">
<textField pattern="MMMMM dd, yyyy">
<reportElement x="457" y="0" width="116" height="15"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MMMM dd, yyyy").format(new java.util.Date())]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="12" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[PU]]></text>
</staticText>
<staticText>
<reportElement x="50" y="0" width="184" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[DESCRIPTION]]></text>
</staticText>
<staticText>
<reportElement x="234" y="0" width="150" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[SIZE]]></text>
</staticText>
<staticText>
<reportElement x="384" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="434" y="0" width="40" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[UNIT]]></text>
</staticText>
<staticText>
<reportElement x="473" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[COST]]></text>
</staticText>
<staticText>
<reportElement x="523" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[AMOUNT]]></text>
</staticText>
<rectangle>
<reportElement mode="Transparent" x="0" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="50" y="0" width="184" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="234" y="0" width="150" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="384" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="434" y="0" width="40" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="474" y="0" width="49" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="523" y="0" width="50" height="12"/>
</rectangle>
</band>
</columnHeader>
<detail>
<band height="12" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{PlantUnit}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="50" y="0" width="184" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Description}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="234" y="0" width="150" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Size}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="384" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Qty}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="433" y="0" width="40" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Unit}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="473" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$F{Unit Price}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="523" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$F{Amount}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement mode="Transparent" x="0" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="50" y="0" width="184" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="234" y="0" width="150" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="384" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="434" y="0" width="40" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="474" y="0" width="49" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="523" y="0" width="50" height="12"/>
</rectangle>
</band>
</detail>
<columnFooter>
<band height="12" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="12"/>
<textElement>
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[Total Amount]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="473" y="0" width="100" height="12"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$V{TotalAmount}]]></textFieldExpression>
</textField>
</band>
</columnFooter>
<pageFooter>
<band height="15" splitType="Stretch">
<textField>
<reportElement x="491" y="0" width="56" height="15"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="547" y="0" width="25" height="15"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="11" splitType="Stretch"/>
</summary>
</jasperReport>
Further assistance would be appreciated.
You have taken the amount field as string.
<field name="Amount" class="java.lang.String"/>
And your variable type is also string.
<variable name="TotalAmount" class="java.lang.String" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
You need to have Amount and TotalAmount variables to be Integer in order for jasper report to be able to calculate the sum. Hence change it to following:
<field name="Amount" class="java.lang.Integer"/>
and
<variable name="TotalAmount" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
Note : If Amount is already String then convert it to Integer and then feed to jasper report.
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>
I am getting the error "Expression list of the form (a; b; c) is not supported in this context" when compiling a report, after removing some fields and adding a few new ones. This prevents the report from being compiled.
I am using iReport 5.1.0.
The full error is as follows:
Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector#19c51d5 net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_Events_1383802163165_797769: 325: Expression list of the form (a; b; c) is not supported in this context. at line: 325 column: 21. File: calculator_Events_1383802163165_797769 # line 325, column 21. 1 error at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:113) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201) at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:240) at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:156) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:439) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:528) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_Events_1383802163165_797769: 325: Expression list of the form (a; b; c) is not supported in this context. at line: 325 column: 21. File: calculator_Events_1383802163165_797769 # line 325, column 21. 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:915) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:540) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:517) at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:109) ... 7 more
As requested, the jrxml is as follows:
<?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="Events" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="81b33856-d23f-41e3-99a1-9ec1f42e7781">
<property name="ireport.zoom" value="1.6105100000000008"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Title" fontName="Arial" fontSize="40" isBold="true" pdfFontName="Times-Bold"/>
<style name="Column Heading" forecolor="#736343" fontName="Arial" fontSize="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="Field Label" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="Detail" fill="Solid" fontName="Arial" fontSize="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="Row" mode="Transparent" fontName="Arial">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<field name="id" class="java.lang.Integer"/>
<field name="timedateStart" class="java.util.Date"/>
<field name="timedateEnd" class="java.util.Date"/>
<field name="timedateReported" class="java.util.Date"/>
<field name="areaStart" class="java.lang.String"/>
<field name="areaEnd" class="java.lang.String"/>
<field name="login" class="java.lang.String"/>
<field name="state" class="java.lang.String"/>
<field name="summary" class="java.lang.String"/>
<field name="details" class="java.lang.String"/>
<field name="tripInvolvement" class="java.lang.String"/>
<field name="tripName" class="java.lang.String"/>
<field name="itsrClass" class="java.lang.String"/>
<field name="closeoutComments" class="java.lang.String"/>
<field name="tripDate" class="java.lang.String"/>
<field name="tripFrom" class="java.lang.String"/>
<field name="tripTo" class="java.lang.String"/>
<field name="tripDelay" class="java.lang.String"/>
<field name="code" class="java.lang.String"/>
<field name="eventNumber" class="java.lang.String"/>
<field name="tripOperator" class="java.lang.String"/>
<field name="safetyComments" class="java.lang.String"/>
<group name="ID" keepTogether="true">
<groupExpression><![CDATA[$F{id}]]></groupExpression>
<groupHeader>
<band height="101">
<textField pattern="dd MMM yy HH:mm">
<reportElement uuid="ccf2faf4-1ebc-4833-bffb-be793843bfbb" style="Detail" x="89" y="29" width="95" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{timedateStart}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="bc927ec0-afbe-4acb-a2dd-30ed83bf87ca" style="Field Label" x="0" y="29" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Start Time:]]></text>
</staticText>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="ca7ec72f-66dc-48ee-a3ba-1a8ad24e5151" style="Detail" x="273" y="29" width="100" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{timedateEnd}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="e4b8515a-e1f4-46a2-b539-609918c274e8" style="Field Label" x="184" y="29" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[End Time:]]></text>
</staticText>
<textField>
<reportElement uuid="b77e01cd-299d-4de2-8087-c2a39dfad2c1" style="Detail" x="273" y="11" width="100" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{areaStart}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="8c7e8a18-8bc1-4458-a8ba-b08289f93d1f" style="Field Label" x="184" y="11" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Start Location:]]></text>
</staticText>
<textField>
<reportElement uuid="f70f1a2a-c8b9-49b8-b89c-e316c0f3d5a9" style="Detail" x="651" y="11" width="151" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{login}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="f66e357d-4951-4bbb-8c5a-7ef6620f2146" style="Field Label" x="562" y="11" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[User:]]></text>
</staticText>
<textField>
<reportElement uuid="62f6ee8e-2f53-4790-abc8-3eb18e0fc373" style="Detail" x="462" y="11" width="100" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{areaEnd}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="608c4c23-f157-4e67-8e3e-2d5e61b973da" style="Field Label" x="373" y="11" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[End Location:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="4e78d65d-579f-46d6-88a9-d32ad8c65603" style="Detail" x="651" y="29" width="151" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{state}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="df4c04ba-02b1-4a5a-85fe-73d696ed4baf" style="Field Label" x="562" y="29" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[State:]]></text>
</staticText>
<textField>
<reportElement uuid="5116325d-bfec-4937-a839-fcaf57ac91f3" style="Detail" x="89" y="65" width="714" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{summary}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="b98c7a80-a12c-4868-8e02-e075a156b085" style="Field Label" x="0" y="65" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Title:]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="8e708653-5838-4046-a081-92035aa855fe" style="Detail" stretchType="RelativeToBandHeight" x="89" y="83" width="714" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{details}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="adc7448c-13a8-4911-b7b6-74e7b9261d7e" style="Field Label" x="0" y="83" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Details:]]></text>
</staticText>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="aa3bc766-6000-47f2-8e65-da927940c456" style="Detail" x="462" y="29" width="100" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{timedateReported}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="72920f21-de19-4494-bbe9-38ae43e263a2" style="Field Label" x="373" y="29" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Report Time:]]></text>
</staticText>
<line>
<reportElement uuid="13211da9-beb1-415c-ac7f-5389686ef661" x="0" y="5" width="802" height="1"/>
<graphicElement>
<pen lineWidth="5.75" lineStyle="Double"/>
</graphicElement>
</line>
<staticText>
<reportElement uuid="ad7bdabe-7f4b-4b72-b99d-6fe18afac7c0" style="Field Label" x="0" y="11" width="89" height="18"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Event Number:]]></text>
</staticText>
<textField>
<reportElement uuid="2148ce11-9119-48e8-8c91-002a7107fbcb" style="Detail" x="89" y="11" width="95" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{eventNumber}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="39bff358-7af5-4752-bfc4-f803bfadab40" style="Field Label" x="0" y="47" width="89" height="18">
<printWhenExpression><![CDATA[$F{code} != null]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right"/>
<text><![CDATA[Code:]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="9730d29d-873b-4d29-b028-48404027e19b" style="Detail" x="89" y="47" width="95" height="18">
<printWhenExpression><![CDATA[$F{code} != null]]></printWhenExpression>
</reportElement>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{code}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="64">
<printWhenExpression><![CDATA[$F{itsrClass} != null]]></printWhenExpression>
<staticText>
<reportElement uuid="10f8cca4-d383-4ba1-9cf4-8795b1b0dd98" style="Field Label" isPrintRepeatedValues="false" x="1" y="6" width="183" height="20" printWhenGroupChanges="ID"/>
<textElement>
<font size="15"/>
</textElement>
<text><![CDATA[Categorisation]]></text>
</staticText>
<staticText>
<reportElement uuid="cfaee340-8abf-4197-8c08-10b10ef66dcf" style="Field Label" isPrintRepeatedValues="false" x="1" y="26" width="115" height="18" printWhenGroupChanges="ID"/>
<textElement textAlignment="Right"/>
<text><![CDATA[ITSR Classification:]]></text>
</staticText>
<staticText>
<reportElement uuid="78403c7e-1d15-4eea-aeca-cc401fbad57a" style="Field Label" isPrintRepeatedValues="false" x="1" y="44" width="115" height="18" printWhenGroupChanges="ID"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Safety Comments:]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="b1edd0e3-7c49-4838-8fc8-6d699873ba85" style="Detail" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="117" y="26" width="684" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{itsrClass}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="b6973a40-0464-410a-9fa5-b3b814e36a31" style="Detail" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="117" y="44" width="684" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{safetyComments}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="5a3a0871-0b2b-4b8d-945b-755259a29f38" x="0" y="3" width="802" height="1"/>
</line>
</band>
<band height="20">
<printWhenExpression><![CDATA[$F{closeoutComments} != null]]></printWhenExpression>
<staticText>
<reportElement uuid="23b26dc6-d74b-45f5-b4f6-c91ca98613b0" style="Field Label" isPrintRepeatedValues="false" x="1" y="0" width="115" height="18" printWhenGroupChanges="ID"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Closeout:]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="91479638-455b-4e46-a6f4-b3dd9d4dc2a8" style="Detail" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="117" y="0" width="684" height="18"/>
<textElement>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{closeoutComments}]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<group name="Trip">
<groupExpression><![CDATA[$F{tripInvolvement}]]></groupExpression>
<groupHeader>
<band height="20">
<printWhenExpression><![CDATA[$F{tripInvolvement} != null]]></printWhenExpression>
<staticText>
<reportElement uuid="1edf4f6a-4acb-4f8f-ac70-f1a3c754567e" style="Field Label" x="89" y="2" width="89" height="18"/>
<textElement/>
<text><![CDATA[Train]]></text>
</staticText>
<staticText>
<reportElement uuid="1f5c9a4e-c5bf-4d27-9f0c-21a42a65ecef" style="Field Label" x="178" y="2" width="100" height="18"/>
<textElement/>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement uuid="1a8a189c-a27e-4ca5-b148-11ed220b2584" style="Field Label" x="515" y="2" width="89" height="18"/>
<textElement/>
<text><![CDATA[From]]></text>
</staticText>
<staticText>
<reportElement uuid="48030e71-fe77-4c61-a106-018c90e536a6" style="Field Label" x="603" y="2" width="100" height="18"/>
<textElement/>
<text><![CDATA[To]]></text>
</staticText>
<staticText>
<reportElement uuid="9c3b0468-afb7-4d7a-be92-db117bc397b2" style="Field Label" x="702" y="2" width="89" height="18"/>
<textElement/>
<text><![CDATA[Delay]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="f4afaf65-7726-4f41-9959-ab9ac23e38a5" style="Detail" stretchType="RelativeToBandHeight" x="0" y="2" width="89" height="18"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$F{tripInvolvement} != null ? ( $F{tripInvolvement}.equals( "primary" ) ? "Primary" : "Reactionary" ) : null]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="7017fd47-578c-4e81-b10f-e2958e53acd8" style="Field Label" x="277" y="2" width="239" height="18"/>
<textElement/>
<text><![CDATA[Operator]]></text>
</staticText>
<line>
<reportElement uuid="fa1ceb36-94f4-4663-a93d-238d17090a6c" x="1" y="0" width="801" height="1"/>
</line>
</band>
</groupHeader>
<groupFooter>
<band/>
</groupFooter>
</group>
<group name="ID Group Footer Response">
<groupExpression><![CDATA[$F{id}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band height="62" splitType="Stretch">
<image isUsingCache="true">
<reportElement uuid="1da1169f-b408-446a-bb59-54c6c8fd916b" x="0" y="0" width="222" height="60"/>
<imageExpression><![CDATA["client_logo.png"]]></imageExpression>
</image>
<staticText>
<reportElement uuid="80d953b0-4a59-4da5-8a65-b837b70c5f00" style="Title" x="184" y="0" width="618" height="60"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font pdfFontName="Times-Roman"/>
</textElement>
<text><![CDATA[Event Report]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="1" splitType="Stretch">
<line>
<reportElement uuid="65b62c3c-1b80-498e-94d5-892b9c188550" positionType="FixRelativeToBottom" x="0" y="0" width="802" height="1"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="19" splitType="Stretch">
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="d2773154-ce1e-4234-bfd3-c7230b1e1cbe" style="Detail" x="89" y="0" width="89" height="18">
<printWhenExpression><![CDATA[$F{tripName} != null;]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripName}]]></textFieldExpression>
</textField>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="a577c389-9b30-439e-bb16-119f8221c87d" style="Detail" x="178" y="0" width="100" height="18">
<printWhenExpression><![CDATA[$F{tripDate} != null;]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripDate}]]></textFieldExpression>
</textField>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="134f90c3-b3b3-4007-8040-c91db462be10" style="Detail" x="515" y="0" width="89" height="18">
<printWhenExpression><![CDATA[$F{tripFrom} != null;]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripFrom}]]></textFieldExpression>
</textField>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="b3648125-f342-4539-ac36-22cfa152c92d" style="Detail" x="603" y="0" width="100" height="18">
<printWhenExpression><![CDATA[$F{tripTo} != null;]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripTo}]]></textFieldExpression>
</textField>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="536f9148-1de2-428b-aa8a-9bdb4488cba3" style="Detail" x="702" y="0" width="89" height="18">
<printWhenExpression><![CDATA[$F{tripDelay} != null]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripDelay}]]></textFieldExpression>
</textField>
<textField pattern="dd MMM yy HH:mm" isBlankWhenNull="true">
<reportElement uuid="b138c7d9-c31c-4c9d-b004-d343ac194448" style="Detail" x="277" y="0" width="239" height="18">
<printWhenExpression><![CDATA[$F{tripFrom} != null;]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{tripOperator}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="24" splitType="Stretch">
<frame>
<reportElement uuid="e73fa5db-7501-44f9-b061-ba0179add4cd" mode="Opaque" x="0" y="0" width="802" height="24" forecolor="#D0B48E" backcolor="#F2EBDF"/>
<textField evaluationTime="Report">
<reportElement uuid="d32aa440-7736-464d-b9ca-4b5ff2c86929" style="Field Label" x="762" y="0" width="40" height="24" forecolor="#736343"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="590794dc-150e-4555-941c-6e9742bc4fd2" style="Field Label" x="682" y="0" width="80" height="24" forecolor="#736343"/>
<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 uuid="4ab75820-1c6a-49de-b76c-272860dc4f7c" style="Field Label" x="0" y="0" width="197" height="24" forecolor="#736343"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
<paragraph leftIndent="10"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<image hAlign="Center">
<reportElement uuid="8dd54fe0-9404-400c-879f-8e5b56d9d839" x="355" y="0" width="96" height="24"/>
<imageExpression><![CDATA["4tel_logo.png"]]></imageExpression>
</image>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
you are using $F{tripFrom} != null; -> ; is not allowed in groovy there is not such a usage
either remove semicolons from all your expressions and printwhenexpressions or
change your report Language from groovy to java
it worked for me
I have the below report, developed using iReport 3.0 (we have to use this version because of system constraints). But no matter what I do, I can not get rid of the white space between the Page Header (addresses) and the Column Header.
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="customisation_summary" pageWidth="595" pageHeight="700" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true">
<style name="alternateStyle" isDefault="false" backcolor="#FFFFFF" fontName="Arial">
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue() % 2 == 0)]]></conditionExpression>
<style isDefault="false" style="alternateStyle" backcolor="#F7F7F7"/>
</conditionalStyle>
</style>
<parameter name="orderId" class="java.lang.String">
<defaultValueExpression><![CDATA[new Integer(0).toString()]]></defaultValueExpression>
</parameter>
<parameter name="REPORT_IMG_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\kukri\\workspaces\\sts_3_0_0\\clubshop\\clubshop\\src\\main\\webapp\\jasper\\images\\"]]></defaultValueExpression>
</parameter>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\kukri\\workspaces\\sts_3_0_0\\clubshop\\clubshop\\src\\main\\webapp\\jasper\\"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT so.customer_id, so.order_date, so.order_ref, p.product_code, p.colour_code, p.name, SUM(soi.quantity) AS quantity, sz.size, '-' AS uom, '-' AS location, scc.unit_charge, SUM(soi.quantity * scc.unit_charge) total_charge
FROM sales_order AS so, sales_order_item AS soi, product AS p, stock AS st, size AS sz, stock_currency_charge AS scc
WHERE so.id = soi.order_id
AND soi.stock_id = st.id
AND st.product_id = p.id
AND st.id = scc.stock_id
AND st.size_id = sz.id
AND so.currency = scc.currency_code
AND so.id = '$P!{orderId}'
GROUP BY st.id
ORDER BY p.name, sz.display_seq]]>
</queryString>
<field name="customer_id" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="order_date" class="java.sql.Timestamp">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="order_ref" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="product_code" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="colour_code" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="quantity" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="size" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="uom" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="location" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="unit_charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="total_charge" class="java.math.BigDecimal">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<title>
<band height="72" isSplitAllowed="false">
<image onErrorType="Icon">
<reportElement key="image-4" x="-1" y="0" width="555" height="71"/>
<imageExpression class="java.lang.String"><![CDATA[$P{REPORT_IMG_DIR} + "//Top_Image.png"]]></imageExpression>
</image>
<staticText>
<reportElement x="307" y="51" width="247" height="20"/>
<textElement textAlignment="Right">
<font size="14"/>
</textElement>
<text><![CDATA[Order Customisation Pick Sheet]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="45">
<staticText>
<reportElement x="399" y="2" width="62" height="18"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Order Ref: ]]></text>
</staticText>
<textField>
<reportElement x="464" y="20" width="92" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.util.Date"><![CDATA[$F{order_date}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="464" y="1" width="93" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{order_ref}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="399" y="20" width="62" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Order Date: ]]></text>
</staticText>
<subreport>
<reportElement x="179" y="1" width="175" height="40"/>
<subreportParameter name="customer_id">
<subreportParameterExpression><![CDATA[$F{customer_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "customisation_jobsheet_summary_invaddy.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="0" y="0" width="175" height="40"/>
<subreportParameter name="customer_id">
<subreportParameterExpression><![CDATA[$F{customer_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "customisation_jobsheet_summary_del_addy.jasper"]]></subreportExpression>
</subreport>
</band>
</pageHeader>
<columnHeader>
<band height="20">
<staticText>
<reportElement mode="Opaque" x="23" y="1" width="79" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Product Code]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="463" y="1" width="39" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[UOM]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="178" y="1" width="231" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Product ]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="102" y="1" width="76" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Colour]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="409" y="1" width="26" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Size]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="435" y="1" width="28" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="501" y="1" width="55" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Location]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="2" y="1" width="21" height="18" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[#]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="19">
<textField>
<reportElement style="alternateStyle" isPrintRepeatedValues="false" x="21" y="1" width="79" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{product_code}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" isPrintRepeatedValues="false" x="176" y="1" width="231" height="18"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" isPrintRepeatedValues="false" x="100" y="1" width="76" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{colour_code}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" x="433" y="1" width="28" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{quantity}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" x="461" y="1" width="39" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{uom}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" x="499" y="1" width="55" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{location}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="1" width="21" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="alternateStyle" x="407" y="1" width="26" height="18"/>
<textElement textAlignment="Center"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{size}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="50"/>
</columnFooter>
<summary>
<band height="80"/>
</summary>
</jasperReport>