Jump to content
We've recently updated our Privacy Statement, available here ×

I am trying to open a report, but it is giving the following error:


natanrc97

Recommended Posts

net.sf.jasperreports.engine.JRException: Error loading expression class : relatorioRegistroAtividade_1620239737181_909989
    at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaCompiler.java:116)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.loadEvaluator(JRAbstractCompiler.java:340)
    at net.sf.jasperreports.engine.JasperCompileManager.getEvaluator(JasperCompileManager.java:378)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:462)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:405)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
    at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:668)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:649)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:971)
    at negocio.relatorio.GeraRelatorioJasperStudioService.geraRelatorio(GeraRelatorioJasperStudioService.java:92)
    at negocio.relatorio.ListaRegistroAtividadeService.montaSql(ListaRegistroAtividadeService.java:190)
    at apresentacao.util.ImprimeCadastro.ImpriRegistroAtividades$1.doInBackground(ImpriRegistroAtividades.java:123)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: net.sf.jasperreports.compilers.ReportExpressionEvaluationData cannot be cast to [b
    at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaCompiler.java:102)
    ... 21 more

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Maybe you used crosstab in your report. Make sure every field is in a proper position. 
If the file in JRXML format, open it in an editor and remove the below code and try to open it again. 

Please backup your previous file also.


<crosstab>

Some code here also 

</crosstab>

Link to comment
Share on other sites

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928  -->
<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="relatorioRegistroAtividade" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="832" leftMargin="5" rightMargin="5" topMargin="5" bottomMargin="5" uuid="d765deb8-938f-4d10-ae2c-d695af7158fd">
    <property name="ireport.zoom" value="1.610510000000009"/>
    <property name="ireport.x" value="120"/>
    <property name="ireport.y" value="0"/>
    <parameter name="infoRel" class="java.lang.String">
        <parameterDescription><![CDATA[]]></parameterDescription>
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <field name="idRegistroAtividade" class="java.lang.Integer"/>
    <field name="idRotina" class="java.lang.Integer"/>
    <field name="nmCliente" class="java.lang.String"/>
    <field name="nmSistema" class="java.lang.String"/>
    <field name="nmUsuario" class="java.lang.String"/>
    <field name="descricao" class="java.lang.String"/>
    <field name="observacao" class="java.lang.String"/>
    <field name="data" class="java.util.Date"/>
    <field name="tempoTotalGasto" class="java.lang.String"/>
    <variable name="segundos" class="java.lang.Long" calculation="Sum">
        <variableExpression><![CDATA[(Integer.valueOf($F{tempoTotalGasto}.substring(0,3).replace(":",""))*60)+Integer.valueOf($F{tempoTotalGasto}.substring(3,6).replace(":",""))]]></variableExpression>
    </variable>
    <variable name="horas" class="java.lang.Long">
        <variableExpression><![CDATA[($V{segundos}/60)]]></variableExpression>
    </variable>
    <variable name="minutos" class="java.lang.Long">
        <variableExpression><![CDATA[($V{segundos})%60]]></variableExpression>
    </variable>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="64" splitType="Stretch">
            <line>
                <reportElement x="0" y="16" width="832" height="1" uuid="160719c9-bbb8-4fab-b073-f413ac8df1f5"/>
            </line>
            <staticText>
                <reportElement x="0" y="19" width="832" height="29" uuid="6096c4bc-cbe6-4e9a-98f0-233be43490f9"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="SansSerif" size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Relatório de Registro de Atividades]]></text>
            </staticText>
            <textField pattern="'Data'  dd/MM/yyyy  'Hora'  HH:mm">
                <reportElement x="572" y="0" width="260" height="14" uuid="39fde5b5-4678-4ec9-b247-79e245eafec4"/>
                <textElement textAlignment="Right"/>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
            <line>
                <reportElement x="0" y="48" width="832" height="1" uuid="379aaa93-0317-4b4b-803d-1cef7b6099de"/>
            </line>
            <staticText>
                <reportElement x="0" y="48" width="105" height="15" uuid="eceab975-8e89-45c0-9d29-8d2d52f1fc70"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="SansSerif" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Filtros Selecionados:]]></text>
            </staticText>
            <textField textAdjust="StretchHeight" pattern="">
                <reportElement stretchType="RelativeToBandHeight" x="105" y="48" width="727" height="15" isRemoveLineWhenBlank="true" uuid="c6cfbde9-1727-49ad-91e6-cc5842598b23"/>
                <textElement textAlignment="Left" verticalAlignment="Middle"/>
                <textFieldExpression><![CDATA[$P{infoRel}]]></textFieldExpression>
            </textField>
        </band>
    </title>
    <columnHeader>
        <band height="15" splitType="Stretch">
            <staticText>
                <reportElement mode="Transparent" x="32" y="0" width="115" height="14" backcolor="#CCCCCC" uuid="da226aac-ddf6-499e-b0de-84309adbd4d7"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Cliente]]></text>
            </staticText>
            <line>
                <reportElement x="0" y="14" width="832" height="1" uuid="a6e4efcf-3a55-4501-9268-4e64a8a8d04d"/>
            </line>
            <staticText>
                <reportElement mode="Transparent" x="147" y="0" width="115" height="14" backcolor="#CCCCCC" uuid="276ae9a3-14cf-4fc5-b24a-a1a4c9903ac4"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[sistema]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="0" y="0" width="32" height="14" backcolor="#CCCCCC" uuid="7f087e20-0167-42ae-b72d-accd5681c713"/>
                <textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Cód.]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="377" y="0" width="175" height="14" backcolor="#CCCCCC" uuid="4aa8983c-90cd-44df-ac69-e779c112303a"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Descrição]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="552" y="0" width="175" height="14" backcolor="#CCCCCC" uuid="2ae4e70e-dc54-4a3c-8f97-a26520f5fb97"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Observação]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="727" y="0" width="50" height="14" backcolor="#CCCCCC" uuid="054d55d7-b34d-4d05-95cb-5654f9cebb9c"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Data]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="777" y="0" width="55" height="14" backcolor="#CCCCCC" uuid="6b8c3b5d-b6df-45e7-b98b-54d58fd294b3"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Tempo Gasto]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Transparent" x="262" y="0" width="115" height="14" backcolor="#CCCCCC" uuid="66f68c8c-f43a-42dc-bb96-ead098be557f"/>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[usuario]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="14" splitType="Stretch">
            <rectangle>
                <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="832" height="14" backcolor="#E0E0E0" uuid="4adb6bf6-6997-4150-bbd7-3b6502dcc2c8">
                    <printWhenExpression><![CDATA[$V{REPORT_COUNT} % 2 == 1]]></printWhenExpression>
                </reportElement>
                <graphicElement>
                    <pen lineWidth="0.0"/>
                </graphicElement>
            </rectangle>
            <textField pattern="">
                <reportElement x="0" y="0" width="32" height="14" uuid="154b8967-6715-479d-aeaf-ec61221a6ebf"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{idRegistroAtividade}]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy">
                <reportElement x="32" y="0" width="115" height="14" uuid="541b3c73-f2fd-4f56-96f7-c1b0432b3cdf"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nmCliente}.trim()]]></textFieldExpression>
            </textField>
            <textField pattern="">
                <reportElement stretchType="RelativeToBandHeight" x="552" y="0" width="175" height="14" uuid="5eca5a74-bbc2-482c-9943-5ec38bde2859"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{observacao}.trim()]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy">
                <reportElement x="727" y="0" width="50" height="14" uuid="f995379f-f00f-4780-8e4d-43d6140a8827"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{data}]]></textFieldExpression>
            </textField>
            <textField pattern="">
                <reportElement x="777" y="0" width="55" height="14" uuid="b989d6f2-2f50-4929-a293-0dff8069436d"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[($F{tempoTotalGasto}.substring($F{tempoTotalGasto}.length()-1).contains(":") ?
$F{tempoTotalGasto}.substring(0, $F{tempoTotalGasto}.length() - 1) :
$F{tempoTotalGasto})]]></textFieldExpression>
            </textField>
            <textField pattern="">
                <reportElement x="147" y="0" width="115" height="14" uuid="faecc6b1-f65e-41e2-883d-0025efffb9a3"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nmSistema}.trim()]]></textFieldExpression>
            </textField>
            <textField pattern="">
                <reportElement x="262" y="0" width="115" height="14" uuid="1422a54c-2be9-48dc-b535-e9b84f4877b0"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nmUsuario}.trim()]]></textFieldExpression>
            </textField>
            <textField pattern="">
                <reportElement stretchType="RelativeToBandHeight" x="377" y="0" width="175" height="14" uuid="8955aafa-d410-4c52-a2ec-100dc422eb5d"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{descricao}.trim()]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <summary>
        <band height="42" splitType="Stretch">
            <textField pattern="">
                <reportElement x="777" y="1" width="55" height="14" uuid="6978ade4-692b-42f8-80f0-5565902dda03"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="10" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[($V{horas} < 10 ? "0"+$V{horas} : $V{horas}) +":"+($V{minutos} < 10 ? "0"+$V{minutos} : $V{minutos})]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Transparent" x="587" y="1" width="190" height="14" backcolor="#CCCCCC" uuid="1311a069-439d-4f13-a6aa-439a24a85f75"/>
                <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
                    <font fontName="Tahoma"/>
                </textElement>
                <text><![CDATA[Total de Horas: ]]></text>
            </staticText>
            <line>
                <reportElement x="0" y="0" width="832" height="1" uuid="62124e8f-6392-4d83-8126-facd96cac23f"/>
            </line>
        </band>
    </summary>
    <noData>
        <band height="50">
            <staticText>
                <reportElement x="0" y="0" width="832" height="50" uuid="c79f3f01-7551-41f4-9cc6-c7ec7022bfc8"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="SansSerif" size="16" isBold="false"/>
                </textElement>
                <text><![CDATA[Não existe dados para este Relatório]]></text>
            </staticText>
        </band>
    </noData>
</jasperReport>
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...