Графики с плагином Jasper не отображаются в формате HTML - PullRequest
0 голосов
/ 21 января 2011

Я использую плагин Jasper для создания диаграмм в своем приложении, я создаю отчет с помощью iReports и настраиваю диаграмму, когда нажимаю кнопку предварительного просмотра, диаграмма хорошо отображается в iReports.

Затем я копирую файл в папку приложения своих отчетов, помещаю тег jasper в list.gsp с форматами PDF и HTML, запускаю приложение и отображаю представление, когда нажимаю на формат PDF для диаграммыпоказывать хорошо, но когда я нажимаю на HTML-формат, на странице появляется разбитое изображение;страница попыталась найти изображение 'nullimg_0_0_9', но не нашла его.

Я поместил файл отчета в //web-app/reports/GraficaOperacionComercialProgramada.jrxml.Я использую Grails 1.3.6, плагин Jasper 1.1.6.3 и iReports 4.0 в Ubuntu 10.10.

Кто-нибудь знает, что я делаю не так?

Это код в моем 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.

1 Ответ

0 голосов
/ 10 февраля 2011

Похоже, вам нужно определить каталог отчетов для плагина jasper. В grails-app / conf / Config.groovy убедитесь, что у вас есть свойство с именем jasper.dir.reports, а его значением должен быть полный путь к файлам jasper или jrxml.

...