开发者

Charts with Jasper Plugin does not show in Html format

开发者 https://www.devze.com 2023-02-05 19:26 出处:网络
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.

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.

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; the page tried to find the 'nullimg_0_0_9' image but it does not find it.

I put the report file in //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.

Any one know what I am do wrong?.

This is the code in my 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">

                </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"> 
            &l开发者_如何学Ct;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.


It sounds like you need to define your reports directory for jasper plugin. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消