Jasper Reports - Compilerproblem nach Umstellung von Groovy auf Java

Joob

Top Contributor
Hallo,

ich will meine Reports von Groovy auf Java (Language) s.u. umstellen.
Leider kann ich nach der Umstellung den Report nicht mehr kompilieren.
Folgende Fehlermeldung :

Code:
  Compiling to file... C:\Users\Jupp\Documents\NetBeansProjects\VTDESKTOP\src\main\resources\REPORTS\Blocks.jasper
Errors compiling C:\Users\Jupp\Documents\NetBeansProjects\VTDESKTOP\src\main\resources\REPORTS\Blocks.jasper!
Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@43162e00  net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files /* ^ 1 errors      at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:512)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)     at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)     at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Compilation running time: 311


Hier die Einstellung :
12503

Hier die Optionen, muss ich da noch was eintragen ?
12506

Ganzer Eintrag unter compiler Classpath
C:\\Program Files\\NetBeans-11.1\\netbeans\\platform\\lib\\boot.jar;C:\\Program Files\\NetBeans-11.1\\netbeans\\platform\\lib\\org-openide-modules.jar;C:\\Program Files\\NetBeans-11.1\\netbeans\\platform\\lib\\org-openide-util-lookup.jar;C:\\Program Files\\NetBeans-11.1\\netbeans\\platform\\lib\\org-openide-util-ui.jar;C:\\Program Files\\NetBeans-11.1\\netbeans\\platform\\lib\\org-openide-util.jar


Hier die Eintragungen unter Classpath
12505
 

Anhänge

  • 1571761158026.png
    1571761158026.png
    24,5 KB · Aufrufe: 49
Hier ist mein jrxml

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="null" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4f48fe3f-c880-4ec9-9108-d900859df9cf">
    <property name="ireport.zoom" value="1.5"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <style name="Heading 1"/>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="book" class="java.lang.String">
        <fieldDescription><![CDATA[book]]></fieldDescription>
    </field>
    <field name="isbn" class="java.lang.String">
        <fieldDescription><![CDATA[isbn]]></fieldDescription>
    </field>
    <field name="language" class="java.lang.String">
        <fieldDescription><![CDATA[language]]></fieldDescription>
    </field>
    <field name="lesson" class="java.lang.String">
        <fieldDescription><![CDATA[lesson]]></fieldDescription>
    </field>
    <sortField name="isbn"/>
    <sortField name="lesson"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="31" splitType="Stretch">
            <staticText>
                <reportElement x="10" y="0" width="300" height="28" uuid="a72cc648-317c-4452-982d-2610c0e04a2a"/>
                <textElement>
                    <font fontName="Arial Black" size="16"/>
                </textElement>
                <text><![CDATA[Blocklist for Language]]></text>
            </staticText>
            <line>
                <reportElement x="10" y="28" width="543" height="1" uuid="18910289-e647-4bd7-a5e2-51ca91e23ffe"/>
            </line>
        </band>
    </title>
    <pageHeader>
        <band height="34" splitType="Stretch">
            <staticText>
                <reportElement x="10" y="0" width="51" height="20" uuid="7751674a-184f-4b0f-9b1d-85c2989dba87"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12"/>
                </textElement>
                <text><![CDATA[language :]]></text>
            </staticText>
            <textField>
                <reportElement x="61" y="0" width="187" height="20" uuid="ffc84dbe-d26e-4307-b450-54532976383e"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{language}]]></textFieldExpression>
            </textField>
        </band>
    </pageHeader>
    <columnHeader>
        <band height="16" splitType="Stretch">
            <staticText>
                <reportElement x="160" y="0" width="201" height="15" uuid="7105f5a1-273c-467d-aee3-8db16572638c"/>
                <textElement>
                    <font fontName="Arial Black" isBold="true"/>
                </textElement>
                <text><![CDATA[BOOK]]></text>
            </staticText>
            <staticText>
                <reportElement x="10" y="0" width="150" height="15" uuid="7f15ee99-0e87-4126-814e-b5d05313ceaa"/>
                <textElement>
                    <font fontName="Arial Black" isBold="true"/>
                </textElement>
                <text><![CDATA[ISBN]]></text>
            </staticText>
            <staticText>
                <reportElement x="361" y="0" width="181" height="15" uuid="cd57a032-e31d-446c-9f31-f4a3be39d083"/>
                <textElement>
                    <font fontName="Arial Black" isBold="true"/>
                </textElement>
                <text><![CDATA[LESSON]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="23" splitType="Stretch">
            <textField>
                <reportElement x="160" y="2" width="201" height="20" uuid="efefe42e-b394-4702-b809-8efb0038f677"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{book}]]></textFieldExpression>
            </textField>
            <textField pattern="" isBlankWhenNull="false">
                <reportElement x="10" y="2" width="150" height="20" uuid="4288d1b8-a22e-4825-aa3f-9fefcbf13cff"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{isbn}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="361" y="2" width="181" height="20" uuid="efd01885-60f9-4e3b-b36f-4f47d09233f0"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{lesson}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="30" splitType="Stretch">
            <textField>
                <reportElement x="433" y="10" width="80" height="20" uuid="2dcf2e46-72c0-47e3-8b0d-fdba36ffdd2d"/>
                <textElement textAlignment="Right">
                    <font fontName="Arial Narrow" size="12" isItalic="false"/>
                </textElement>
                <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="513" y="10" width="40" height="20" uuid="dc6a084c-0f08-4835-99ab-0ffd3f978680"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12" isItalic="false"/>
                </textElement>
                <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy HH.mm.ss">
                <reportElement x="51" y="10" width="122" height="20" uuid="2f40a28d-a202-4c53-9d7d-c20b416e5541"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12" isItalic="false"/>
                </textElement>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="10" y="10" width="41" height="20" uuid="e0f1138b-d718-437a-ab0b-666cd7218f16"/>
                <textElement>
                    <font fontName="Arial Narrow" size="12" isItalic="false"/>
                </textElement>
                <text><![CDATA[Printed :]]></text>
            </staticText>
        </band>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>
 
Eine interessante Wendung.


Meines Erachtens nachdem ich in gradle.build eingebaut haben

compile group: 'org.eclipse.jdt.core.compiler', name: 'ecj', version: '4.6.1'

und dann im Quellcode compiliere.
Code:
JasperReport jasperReport = JasperCompileManager.compileReport(getClass().getResourceAsStream("/REPORTS/BlocksWords.jrxml"));

leider wirkt sich das nicht auf die Subreports aus. Diese werden als .jasper verwendet und dort ist groovy die language.

Also bleibt mein Problem bestehen, da ich es nicht auf die Kette bekommen ecj in der IDE zu integrieren.
Meine Theorie ist dann sollte auch das compilen in der Bearbeitungsansicht funktionieren und dann würden die
SubReports sofort mit kompiliert.
 
Ich kann das jrxml Problemlos in einem JasperStudio 6.8.0 kompilieren. Hat es einen Grund, dass du noch den alten iReport verwendest? Was ist deine Jasper Zielversion?
 
Ich hab jetzt alle Reports mit Jasper Studio compiliert das haut hin.
Dann hab ich gedacht mach ich halt alles mit Jasper Studio.

Nehm ich nur die Kompilierten Reports, also :
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(getClass().getResourceAsStream("/REPORTS/Blocks.jasper"));
// JasperReport jasperReport = JasperCompileManager.compileReport(getClass().getResourceAsStream("/REPORTS/Blocks.jrxml"));

umstellen, hätte dann ja laufen können.
Tuts aber nicht.

Gibt es eine Alternative zu Jasper.
Das ist mir zu unübersichtlich.

Die Version ist mir total egal, ich will Stabilität und nicht immer das Gefühl im Nacken das wenn ich die IDE update
ich mich wochenlang mit so einem Scheiß rumschlagen muss.
Ich kann meine Klassen erstellen und Daten zusammenstellen das haut einwandfrei hin, dann kommen die Tools
und ändern irgendwelche Sachen und nichts läuft mehr stabil.
 
@Wurstkopp : Ich hatte gestern die Nase voll, heute noch mal.
@mihe7

Also mein Konzept ist jetzt
erstellen und compilieren der Reports in Jasper Studio
kopieren der .jasper in das Projekt

Kein Kompilieren mehr.
Kompilerversion in gradle und jasper studio abstimmen

Meinst du das das geht
 
@mihe7
@Wurstkopp

Ich habs umgesetzt und es ist übersichtlich.
Ich habe keine Verwicklungen mit der IDE die mich wahnsinig gemacht haben.
Der Versionsabgleich ist übersichtlich.
Ich bin so zufrieden.

Danke für euer Hilfe.
 

Zurück
Oben