简体   繁体   English

带有Jasper插件的图表未以HTML格式显示

[英]Charts with Jasper Plugin does not show in Html format

I am using Jasper plugin to create charts in my app, I create a report with iReports and setup the chart, when I click on preview button the chart show well in iReports. 我正在使用Jasper插件在我的应用程序中创建图表,我使用iReports创建报告并设置图表,当我单击预览按钮时,图表在iReports中显示良好。

Then I copy the file to my reports app folder, I put a jasper tag in a list.gsp with PDF and HTML formats, run de application, and display the view, when I clic on PDF format the chart show well, but when I clic on HTML format the page show a broken image; 然后将文件复制到我的报告应用文件夹,将jasper标记放入具有PDF和HTML格式的list.gsp中,运行应用程序,并显示视图,当我选择PDF格式时,图表显示良好,但是当我按HTML格式,页面显示损坏的图像; the page tried to find the 'nullimg_0_0_9' image but it does not find it. 该页面试图找到'nullimg_0_0_9'图片,但找不到。

I put the report file in //web-app/reports/GraficaOperacionComercialProgramada.jrxml. 我将报告文件放在//web-app/reports/GraficaOperacionComercialProgramada.jrxml中。 I am using Grails 1.3.6, Jasper Plugin 1.1.6.3 and iReports 4.0 on Ubuntu 10.10. 我在Ubuntu 10.10上使用Grails 1.3.6,Jasper Plugin 1.1.6.3和iReports 4.0。

Any one know what I am do wrong?. 有人知道我做错了吗?

This is the code in my list.gsp: 这是我的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> 

This is the report's code: 这是报告的代码:

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"> 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> 

Thanks in advance, ESalomon. 在此先感谢,ESalomon。

It sounds like you need to define your reports directory for jasper plugin. 听起来您需要为jasper插件定义报告目录。 In grails-app/conf/Config.groovy make sure you have property named jasper.dir.reports and its value should be a full path to your jasper or jrxml files. 在grails-app / conf / Config.groovy中,确保您具有名为jasper.dir.reports的属性,并且其值应为jasper或jrxml文件的完整路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM