0

When i compile my .jrxml file from iReport i have no issue and everything goes fine. but when I try to print from my Java program it's show an error like this:

Error evaluating expression : Source text : new java.lang.Integer(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="TOM_list_ot_report" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="822" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" uuid="581e1703-9505-417f-be68-bada03c8d692">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <style name="table">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <subDataset name="Table Dataset 1" uuid="8573296a-9744-48d2-bb40-8c4b100b3bc9"/>
    <parameter name="ttLogo" class="java.lang.String"/>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="client" class="java.lang.Object"/>
    <field name="adresse" class="java.lang.Object"/>
    <field name="refCommande" class="java.lang.String"/>
    <field name="codeAccees" class="java.lang.String"/>
    <field name="numeroTt" class="java.lang.String"/>
    <field name="commandeEtat" class="java.lang.Object"/>
    <field name="dateModif" class="java.util.Date"/>
    <field name="dateContractuel" class="java.util.Date"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="89" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="822" height="58" forecolor="#000099" uuid="9d752cf8-e79a-4315-aff6-74fbf7c58a0e"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="28" isBold="true"/>
                </textElement>
                <text><![CDATA[Commande livraison]]></text>
            </staticText>
            <image scaleImage="FillFrame" onErrorType="Blank">
                <reportElement x="3" y="0" width="83" height="58" uuid="f5132dfc-fd13-43b3-9331-2eb7cc813690"/>
                <imageExpression><![CDATA[$P{ttLogo}]]></imageExpression>
            </image>
            <textField pattern="dd/MM/yyyy HH.mm a" isBlankWhenNull="true">
                <reportElement x="681" y="68" width="141" height="20" uuid="af0f8b1b-4a6e-49b7-84d9-d733bdf3f71f"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Transparent" x="663" y="68" width="16" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="7ef40ab2-434f-426f-979e-de7b35e7abac"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
                    <font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <text><![CDATA[LE]]></text>
            </staticText>
            <textField isBlankWhenNull="true">
                <reportElement x="537" y="68" width="123" height="20" isRemoveLineWhenBlank="true" uuid="6892eaba-9d98-43ba-8ca6-8207d840f6ae">
                    <printWhenExpression><![CDATA[($F{adresse} != null) && ($F{adresse}.getRegionDTO() != null)]]></printWhenExpression>
                </reportElement>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="10" isBold="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{adresse}.getRegionDTO().getLibelleRegion()]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="113" y="68" width="130" height="20" isRemoveLineWhenBlank="true" uuid="7217ea18-cb33-497e-a81d-47693a082e94">
                    <printWhenExpression><![CDATA[($F{adresse} != null) && ($F{adresse}.getRegionDTO() != null)]]></printWhenExpression>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{adresse}.getRegionDTO().getLibelleRegion()]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="3" y="68" width="110" height="20" uuid="97975b5e-d13a-4ccb-9c5a-0ff5e5ccfa33"/>
                <box rightPadding="5"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Serif" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Direction regionale de  :]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="21"/>
    </pageHeader>
    <columnHeader>
        <band height="20">
            <rectangle>
                <reportElement x="0" y="0" width="179" height="20" backcolor="#CCFFFF" uuid="6eab9b5b-ac19-432e-991e-00f335d798ea"/>
            </rectangle>
            <rectangle>
                <reportElement x="179" y="0" width="52" height="20" backcolor="#CCFFFF" uuid="17822259-754f-4b8b-8684-f141f6379f3e"/>
            </rectangle>
            <rectangle>
                <reportElement x="231" y="0" width="63" height="20" backcolor="#CCFFFF" uuid="14c21801-ecd6-45c9-8ded-3d72d8fdecfa"/>
            </rectangle>
            <rectangle>
                <reportElement x="294" y="0" width="89" height="20" backcolor="#CCFFFF" uuid="89beeeee-3d35-49fb-93ef-0b997db15681"/>
            </rectangle>
            <rectangle>
                <reportElement x="383" y="0" width="144" height="20" backcolor="#CCFFFF" uuid="07215401-8b52-420d-9b2d-af2b49f11f70"/>
            </rectangle>
            <rectangle>
                <reportElement x="527" y="0" width="140" height="20" backcolor="#CCFFFF" uuid="15d4de45-b59d-40b9-a317-11d3db940cc6"/>
            </rectangle>
            <rectangle>
                <reportElement x="667" y="0" width="64" height="20" backcolor="#CCFFFF" uuid="e32b46cb-8c79-415f-b837-b1e455bc538d"/>
            </rectangle>
            <rectangle>
                <reportElement x="731" y="0" width="91" height="20" backcolor="#CCFFFF" uuid="daa5973a-d676-473a-b4dd-e5a7d2ff3a12"/>
            </rectangle>
            <staticText>
                <reportElement x="0" y="0" width="179" height="20" uuid="c045c618-ae04-4267-9146-0e81a7dcfc9b"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Ref. Commande]]></text>
            </staticText>
            <staticText>
                <reportElement x="179" y="0" width="52" height="20" uuid="7a049ea7-efee-492b-85dc-2524a1ff3ae6"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Numéro]]></text>
            </staticText>
            <staticText>
                <reportElement x="231" y="0" width="63" height="20" uuid="1239f061-63fd-441e-af4a-0cda6c733ff7"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Id Access]]></text>
            </staticText>
            <staticText>
                <reportElement x="294" y="0" width="89" height="20" uuid="cd63d966-725e-4e23-8127-d97559e2651f"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Nom et prénom ]]></text>
            </staticText>
            <staticText>
                <reportElement x="383" y="0" width="144" height="20" uuid="bd6a1270-45e2-432b-86b3-ec6b0d86d7c9"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Adresse installation]]></text>
            </staticText>
            <staticText>
                <reportElement x="527" y="0" width="140" height="20" uuid="a6bb97eb-d4d5-4188-ae80-51ca1706c1c7"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Etat commande]]></text>
            </staticText>
            <staticText>
                <reportElement x="667" y="0" width="64" height="20" uuid="6c678f82-a385-4c95-80cc-609d3506ab19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Date état]]></text>
            </staticText>
            <staticText>
                <reportElement x="731" y="0" width="91" height="20" uuid="a47f5765-1f07-4b8a-ba9b-ac330bedffa8"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Date contractuel]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="32" splitType="Stretch">
            <rectangle>
                <reportElement x="0" y="0" width="179" height="32" uuid="ec0f3d1e-71e0-49a8-af72-3b878bc1737d"/>
            </rectangle>
            <rectangle>
                <reportElement x="179" y="0" width="52" height="32" uuid="fe0f82ad-508a-493a-af0f-835a93a3c9ea"/>
            </rectangle>
            <rectangle>
                <reportElement x="231" y="0" width="63" height="32" uuid="4e6fefd5-9b92-451c-a4f0-a91e7d68c8f0"/>
            </rectangle>
            <rectangle>
                <reportElement x="294" y="0" width="89" height="32" uuid="552df758-27c4-4800-b499-9be13265694c"/>
            </rectangle>
            <rectangle>
                <reportElement x="383" y="0" width="144" height="32" uuid="5bcb83e6-3cbb-443a-83b9-ddedf55c573e"/>
            </rectangle>
            <rectangle>
                <reportElement x="527" y="0" width="140" height="32" uuid="102743e9-f3cf-4100-a616-b0adb77dec36"/>
            </rectangle>
            <rectangle>
                <reportElement x="667" y="0" width="64" height="32" uuid="071d3f95-5839-43ac-8bb2-9fb85df2f7c0"/>
            </rectangle>
            <rectangle>
                <reportElement x="731" y="0" width="91" height="32" uuid="5567c999-0396-46e1-b876-a9c496f38267"/>
            </rectangle>
            <textField isBlankWhenNull="true">
                <reportElement x="6" y="0" width="169" height="32" isRemoveLineWhenBlank="true" uuid="e364eaad-cfb7-4df7-95cb-831522e56594"/>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{refCommande}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="184" y="0" width="42" height="32" isRemoveLineWhenBlank="true" uuid="9ee64eaf-d92e-469a-bd84-150309c21fda"/>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{numeroTt}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="236" y="0" width="53" height="32" isRemoveLineWhenBlank="true" uuid="5a3954a9-378f-4879-afac-11732b8dcf23"/>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{codeAccees}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="299" y="0" width="79" height="32" isRemoveLineWhenBlank="true" uuid="4b2c6948-0b49-4950-93c9-a6fa8f579032">
                    <printWhenExpression><![CDATA[$F{client} != null]]></printWhenExpression>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{client}.getFullName()]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="388" y="0" width="134" height="32" isRemoveLineWhenBlank="true" uuid="4e8bf206-9f34-4633-b070-225bb02bb9a5">
                    <printWhenExpression><![CDATA[$F{adresse} != null]]></printWhenExpression>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{adresse}.getAdresseLabel()]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="532" y="0" width="130" height="32" isRemoveLineWhenBlank="true" uuid="6085dd50-e9e6-47e9-9622-577e224b4306">
                    <printWhenExpression><![CDATA[$F{commandeEtat} != null]]></printWhenExpression>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{commandeEtat}.getLibEtatCmd()]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true">
                <reportElement x="672" y="0" width="54" height="32" isRemoveLineWhenBlank="true" uuid="3b8f5c69-ae9c-4dd8-9f8f-00ed310d39c5"/>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{dateModif}]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
                <reportElement x="737" y="0" width="81" height="32" isRemoveLineWhenBlank="true" uuid="33512a65-6207-4805-93a2-4cc48c580ac4"/>
                <textElement verticalAlignment="Middle">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{dateContractuel}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <pageFooter>
        <band height="14"/>
    </pageFooter>
</jasperReport>

Any ideas ?

UPDATE I tried to change the language to Java. and i got some errors when i compile:

The method getRegionDTO() is undefined for the type Object  
The method getRegionDTO() is undefined for the type Object  
The method getRegionDTO() is undefined for the type Object  
The method getFullName() is undefined for the type Object   
The method getAdresseLabel() is undefined for the type Object   
The method getLibEtatCmd() is undefined for the type Object
Marouane Lakhal
  • 774
  • 1
  • 15
  • 42
  • 1
    StackTrace is often usefull in finding out what's wrong. However - does it go away if you change the report language to Java (from Groovy)? – Deltharis May 29 '15 at 08:56
  • Deltharis, i've seen the StackTrace as you suggested and i found out this exception java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/BytecodeInterface8. and thanks to this post (http://stackoverflow.com/questions/11773702/exception-java-lang-noclassdeffounderror-on-jasper-report) i fixed the issue. There was a version mismatch. for jasper 5.5.0 i had groovy 1.7.5 but i needed the groovy 2.0.1 version. – Marouane Lakhal May 29 '15 at 09:34

1 Answers1

0

I just changed the version to groovy 2.0.1. I had the groovy 1.7.5 version which doesn't match the jasper 5.5.0.

This post helped me fix the issue.

Community
  • 1
  • 1
Marouane Lakhal
  • 774
  • 1
  • 15
  • 42