【问题标题】:Charts with Jasper Plugin does not show in Html format带有 Jasper 插件的图表不以 Html 格式显示
【发布时间】:2011-02-10 07:11:14
【问题描述】:

我正在使用 Jasper 插件在我的应用程序中创建图表,我使用 iReports 创建报告并设置图表,当我单击预览按钮时,图表在 iReports 中显示良好。

然后我将文件复制到我的报告应用程序文件夹中,我将一个 jasper 标记放在具有 PDF 和 HTML 格式的 list.gsp 中,运行 de 应用程序并显示视图,当我单击 PDF 格式时,图表显示良好,但是当我点击 HTML 格式时,页面显示损坏的图像;该页面试图找到“nullimg_0_0_9”图像,但没有找到。

我将报告文件放在 //web-app/reports/GraficaOperacionComercialProgramada.jrxml 中。 我在 Ubuntu 10.10 上使用 Grails 1.3.6、Jasper 插件 1.1.6.3 和 iReports 4.0。

有人知道我做错了什么吗?

这是我 list.gsp 中的代码:

<g:jasperReport 
        jasper="GraficaOperacionComercialProgramada" 
        format="${message(code: 'global.formatosReportes.label')}" 
        name="Gráfica sobre el total de carga por tipo de operación"> 
    <br> 
</g:jasperReport> 

这是报告的代码:

http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="GraficaOperacionComercialProgramada2" language="groovy" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20 " topMargin="20" bottomMargin="20">

                </textElement> 
                <text><![CDATA[Gráfica Concepto - Total de carga por categoría]]></text> 
            </staticText> 
        </band> 
    </title> 
    <pageHeader> 
        <band height="35" splitType="Stretch"/> 
    </pageHeader> 
    <columnHeader> 
        <band height="20" splitType="Stretch"> 
            <staticText> 
                <reportElement x="36" y="0" width="100" height="20"/> 
                <textElement> 

                </textElement> 
                <text><![CDATA[categoria]]></text> 
            </staticText> 
            <staticText> 
                <reportElement x="220" y="0" width="100" height="20"/> 
                <textElement> 

                </textElement> 
                <text><![CDATA[totalPasajeros]]></text> 
            </staticText> 
        </band> 
    </columnHeader> 
    <detail> 
        <band height="22" splitType="Stretch"> 
            <textField> 
                <reportElement x="36" y="0" width="100" height="20"/> 
                <textElement/> 
                <textFieldExpression class="java.lang.String"><![CDATA[$F{categoria}]]></textFieldExpression> 
            </textField> 
            <textField> 
                <reportElement x="220" y="2" width="100" height="20"/> 
                <textElement/> 
                <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{totalPasajeros}]]></textFieldExpression> 
            </textField> 
        </band> 
    </detail> 
    <columnFooter> 
        <band height="45" splitType="Stretch"/> 
    </columnFooter> 
    <pageFooter> 
        <band height="54" splitType="Stretch"/> 
    </pageFooter> 
    <summary> 
        <band height="340" splitType="Stretch"> 
            <pieChart> 
                <chart> 
                    <reportElement x="0" y="0" width="572" height="340"/> 
                    <chartTitle/> 
                    <chartSubtitle/> 
                    <chartLegend/> 
                </chart> 
                <pieDataset> 
                    <keyExpression><![CDATA[$F{categoria}]]></keyExpression> 
                    <valueExpression><![CDATA[$F{totalPasajeros}]]></valueExpression> 
                    <labelExpression><![CDATA[$F{categoria}]]></labelExpression> 
                </pieDataset> 
                <piePlot> 
                    <plot/> 
                    <itemLabel color="#000000" backgroundColor="#FFFFFF"/>
                </piePlot> 
            </pieChart> 
        </band> 
    </summary> 
</jasperReport> 

提前致谢,ESalomon。

【问题讨论】:

    标签: html image grails charts jasper-plugin


    【解决方案1】:

    听起来您需要为 jasper 插件定义报告目录。在 grails-app/conf/Config.groovy 中确保您有名为 jasper.dir.reports 的属性,其值应该是您的 jasper 或 jrxml 文件的完整路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-24
      • 1970-01-01
      • 2011-09-23
      • 2014-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多