JasperReports Server没有使用数学计算加载我的报告

时间:2013-05-24 07:02:00

标签: java jasper-reports jasperserver

我有数学公式的报告,当我使用我的 JasperSoft Studio 运行时,我没有任何问题,但是当我将它上传到 JasperReports服务器时,它会抛出以下内容错误。

错误消息

com.jaspersoft.jasperserver.api.JSExceptionWrapper: Errors were encountered when compiling report

expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_newOb_1369378092640_55446: 13: unable to resolve class 
net.sf.jasperreports.expressions.functions.MathFunctions @ line 13, column 1. calculator_newOb_1369378092640_55446: 14: unable to resolve class 
net.sf.jasperreports.expressions.functions.DateTimeFunctions @ line 14, column 1. calculator_newOb_1369378092640_55446: 13: unable to resolve class 
net.sf.jasperreports.expressions.functions.MathFunctions @ line 13, column 1. calculator_newOb_1369378092640_55446: 14: unable to resolve class 
net.sf.jasperreports.expressions.functions.DateTimeFunctions @ line 14, column 1. calculator_newOb_dsnewob_1369378092640_55446: 13: unable to resolve class
net.sf.jasperreports.expressions.functions.MathFunctions @ line 13, column 1. calculator_newOb_dsnewob_1369378092640_55446: 14: unable to resolve class 
net.sf.jasperreports.expressions.functions.DateTimeFunctions @ line 14, column 1. calculator_newOb_dsnewob_1369378092640_55446: 13: unable to resolve class 
net.sf.jasperreports.expressions.functions.MathFunctions @ line 13, column 1. calculator_newOb_dsnewob_1369378092640_55446: 14: unable to resolve class 
net.sf.jasperreports.expressions.functions.DateTimeFunctions @ line 14, column 1. 8 errors

我尝试删除静态。

<import value="static net.sf.jasperreports.expressions.functions.MathFunctions.*"/> <import value="static net.sf.jasperreports.expressions.functions.DateTimeFunctions.*"/>

<?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="TEST" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3646cccc-f7aa-43f1-b43c-8dad73a31214">
    <import value="static net.sf.jasperreports.expressions.functions.MathFunctions.*"/>
    <import value="static net.sf.jasperreports.expressions.functions.DateTimeFunctions.*"/>
    <style name="mystyle">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{severity}== 6]]></conditionExpression>
            <style forecolor="#FA3A3A"/>
        </conditionalStyle>
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{severity}== 5]]></conditionExpression>
            <style forecolor="#FA6C3A"/>
        </conditionalStyle>
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{severity}== 4]]></conditionExpression>
            <style forecolor="#FFAC36"/>
        </conditionalStyle>
    </style>
    <subDataset name="dsnewob" uuid="e10a0858-d297-46ec-a3e6-31a5a18f8189">
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="CopyofOSVM"/>
        <field name="id" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_created" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_last_modified" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_start" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_end" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_last_observed" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="severity" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="category" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="event_name" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="event_id" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="customer_id" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="subject_id" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="subject_best_match" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="subject_unique_name" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="state" class="java.lang.Integer">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="os_name" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="vendor" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="product" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="product_version" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
    </subDataset>

    <field name="id" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="date_created" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="date_last_modified" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="date_start" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="date_end" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="date_last_observed" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="severity" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="category" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="event_name" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="event_id" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="customer_id" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="subject_id" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="subject_best_match" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="subject_unique_name" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="state" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="os_name" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="vendor" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="product" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="product_version" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <variable name="varDate" class="java.lang.String">
        <variableExpression><![CDATA[new Integer($F{date_last_observed}.getDate())]]></variableExpression>
    </variable>
    <variable name="Variable_1" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="54" splitType="Stretch">
            <staticText>
                <reportElement uuid="69d3ea85-0743-4b5d-a9bd-d8cbe1700b83" x="470" y="30" width="70" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Severity]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="2871312a-24c1-4f88-a73d-3a9b603d94e4" x="0" y="30" width="100" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[First Observed]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="89e625e0-69ac-4d5c-91db-0c47933200dd" x="260" y="30" width="100" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Name]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="1822ab85-8e73-434f-a1c9-eb26c1e381f5" x="0" y="0" width="180" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="12" isBold="true"/>
                </textElement>
                <text><![CDATA[New Observations]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="b7c074e6-d95f-42e4-ad07-4245a7eb4246" x="130" y="30" width="100" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[Last Observed]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="38" splitType="Stretch">
            <textField>
                <reportElement uuid="04627003-c85d-4336-a891-bfa49556a5fa" x="0" y="0" width="130" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="11"/>
                </textElement>
                <textFieldExpression><![CDATA[new java.text.SimpleDateFormat("MMM dd, yyyy").format($F{date_start})]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="bdfcb8d5-2015-4d28-97e7-87daf3bc9d0b" x="260" y="0" width="210" height="20"/>
                <textElement>
                    <font fontName="Tahoma" size="11" isUnderline="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{event_name}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement uuid="6f842be1-63a0-4a05-b741-c1c3e15a8eaf" style="mystyle" x="480" y="0" width="70" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{severity} == 6 ?
    "Critical" :
$F{severity} == 5 ?
    "High" :
    $F{severity} == 4 ?
    "Medium":
 $F{severity} == 3 ?
    "Low":
 $F{severity} == 2 ?
    "informational":""]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement uuid="78b1b0de-9540-4cc0-8f13-0ead0a5dce1c" x="70" y="0" width="70" height="20" forecolor="#FF0000"/>
                <textElement>
                    <font fontName="Tahoma" size="11" isBold="true"/>
                </textElement>
                <text><![CDATA[New]]></text>
            </staticText>
            <textField>
                <reportElement uuid="25f1eabe-f0a0-48fb-8f36-53173d7ac6c6" x="130" y="-2" width="290" height="30"/>
                <textElement/>
                <textFieldExpression><![CDATA[(int)(FLOOR(DAYS(DATE(new Integer($F{date_last_modified}.getYear()+1900),new Integer($F{date_last_modified}.getMonth()+1),new Integer($F{date_last_modified}.getDate())),DATE(2013,05,20))/7))]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>

0 个答案:

没有答案