Jump to content
Changes to the Jaspersoft community edition download ×

Loosing elements rendering XLS, HTML


Recommended Posts

By: vertebreaker - vertebreaker

Loosing elements rendering XLS, HTML

2006-06-23 13:00

Hello.

I have a problem when exporting the report to XLS and HTML.

Some elements are not rendering. I can see the report, but some text or lines are lost.

The elements lost are the first ones on each section, and when I move (cut-paste) one of the first elements in <band> to the last, before </band>, it appears in the report, but another element is lost (one of the first). Like a FIFO.

Just the last will appear. No exceptions, no errors, just does not appear.

It´s maybe because of the amount of elements in the report (53 elements):

- 35 elements in pageHeader (3 rectangles, 2 images, 4 lines, 10 textField, 16 staticText)

- 12 elements in detail (5 textFields, 7 lines)

- 6 elements in footer (1 rectangle, 1 line, 2 textFields, 2 staticText)

 

Maybe the jasperPrint object has a maximum size to be set?

 

When I export to PDF there is no problem, but I do it with JasperRunManager.runReportToPdf(reporte.getArchivoReporteJasper().getPath(),reporte.getParametros(),collection);

No JasperPrint object needed.

 

Then everything is fine.

Bellow is the code that generates the HTML and the .jrxml.

 

Thank you.

=================================

JRBeanCollectionDataSource collection = new JRBeanCollectionDataSource(reporte.getColeccionDatos()); jp = JasperFillManager.fillReport(reporte.getArchivoReporteJasper().getPath(),reporte.getParametros(),collection);

 

JRHtmlExporter exporter = new JRHtmlExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,response.getWriter());

HashMap imagesMap = new HashMap();

exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);

request.getSession().setAttribute("IMAGES_MAP", imagesMap);

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image=");

exporter.exportReport();

============================================

 

===================================================

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created using an evaluation version of JasperAssistant (http://www.jasperassistant.com) -->

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="ListaInscritosCurso" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20">

<property name="com.jasperassistant.designer.Locale" value="es_EC"/>

<reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="10" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<parameter name="titulo_reporte" class="java.lang.String">

</parameter>

<parameter name="codigo_reporte" class="java.lang.String">

</parameter>

<parameter name="responsable" class="java.lang.String">

</parameter>

<parameter name="usuario" class="java.lang.String">

</parameter>

<parameter name="directorio_base" class="java.io.File">

</parameter>

<parameter name="cursoPlanificado_referencia" class="java.lang.String">

</parameter>

<parameter name="cursoPlanificado_nombre" class="java.lang.String">

</parameter>

<parameter name="cursoPlanificado_fecha" class="java.lang.String">

</parameter>

<parameter name="cursoPlanificado_valor" class="java.lang.String">

</parameter>

<parameter name="cursoPlanificado_numero_inscritos" class="java.lang.Integer">

</parameter>

<field name="inscrito.identificacion" class="java.lang.String">

</field>

<field name="inscrito.especialidadString" class="java.lang.String">

</field>

<field name="numeroFacturaString" class="java.lang.String">

</field>

<field name="inscrito.nombreCompleto" class="java.lang.String">

</field>

<title>

<band>

</band>

</title>

<pageHeader>

<band height="280">

<rectangle>

<reportElement positionType="Float" x="7" y="40" width="500" height="115"/>

<graphicElement/>

</rectangle>

<rectangle>

<reportElement positionType="Float" x="112" y="40" width="290" height="115"/>

<graphicElement/>

</rectangle>

<line>

<reportElement positionType="Float" x="112" y="135" width="395" height="1"/>

<graphicElement/>

</line>

<line>

<reportElement x="1" y="0" width="515" height="1"/>

<graphicElement/>

</line>

<textField isBlankWhenNull="true">

<reportElement x="112" y="75" width="290" height="45"/>

<textElement textAlignment="Center">

<font fontName="Times New Roman" size="12" isBold="true" pdfFontName="Times-Bold"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{titulo_reporte}]]></textFieldExpression>

</textField>

<staticText>

<reportElement positionType="Float" x="114" y="0" width="286" height="47"/>

<textElement textAlignment="Center">

<font fontName="Times New Roman" size="8" isBold="true" pdfFontName="Times-Roman"/>

</textElement>

<text><![CDATA[ARMADA DEL ECUADOR

ESCUELA DE LA MARINA MERCANTE NACIONAL

Guayaquil

-0-]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="7" y="40" width="105" height="15"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[iSO 9001 - 2000]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="7" y="140" width="105" height="15"/>

<textElement textAlignment="Center">

<font size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[ESMENA]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="117" y="50" width="80" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[FORMATO:]]></text>

</staticText>

<textField>

<reportElement x="402" y="135" width="60" height="20"/>

<textElement textAlignment="Right" verticalAlignment="Middle"/>

<textFieldExpression class="java.lang.String"><![CDATA["Pág. " + String.valueOf($V{PAGE_NUMBER}) + " /"]]></textFieldExpression>

</textField>

<textField evaluationTime="Report">

<reportElement x="462" y="135" width="45" height="20"/>

<textElement verticalAlignment="Middle"/>

<textFieldExpression class="java.lang.String"><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></textFieldExpression>

</textField>

<staticText>

<reportElement positionType="Float" x="117" y="135" width="60" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[CÓDIGO:]]></text>

</staticText>

<textField isBlankWhenNull="true">

<reportElement positionType="Float" x="402" y="115" width="105" height="20"/>

<textElement textAlignment="Center"/>

<textFieldExpression class="java.lang.String"><![CDATA[$P{responsable}]]></textFieldExpression>

</textField>

<textField isBlankWhenNull="true">

<reportElement positionType="Float" x="177" y="135" width="160" height="20"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Times New Roman" size="12" isBold="true" pdfFontName="Times-Bold"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{codigo_reporte}]]></textFieldExpression>

</textField>

<image hAlign="Center" vAlign="Middle" onErrorType="Blank">

<reportElement positionType="Float" x="407" y="43" width="94" height="40"/>

<graphicElement/>

<imageExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/logoBvqiNegro.jpg"]]></imageExpression>

</image>

<image isUsingCache="false" onErrorType="Blank">

<reportElement positionType="Float" x="22" y="60" width="75" height="75"/>

<box topBorder="None" topBorderColor="#0" leftBorder="None" leftBorderColor="#0" bottomBorder="None" bottomBorderColor="#0" rightBorder="None" rightBorderColor="#ffffff"/>

<graphicElement/>

<imageExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/logoesmena.jpg"]]></imageExpression>

</image>

<line>

<reportElement positionType="Float" x="402" y="85" width="105" height="1"/>

<graphicElement/>

</line>

<staticText>

<reportElement positionType="Float" x="10" y="175" width="55" height="25"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[CURSO:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="10" y="200" width="55" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[FECHA:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="10" y="240" width="110" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[# DE INSCRITOS:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="10" y="220" width="55" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[VALOR:]]></text>

</staticText>

<textField>

<reportElement positionType="Float" x="65" y="175" width="450" height="25"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="10" isBold="false" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{cursoPlanificado_referencia}+" - "+$P{cursoPlanificado_nombre}]]></textFieldExpression>

</textField>

<textField pattern="dd-MMM-yyyy">

<reportElement positionType="Float" x="65" y="200" width="450" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="10" isBold="false" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{cursoPlanificado_fecha}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="65" y="220" width="450" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="10" isBold="false" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{cursoPlanificado_valor}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="120" y="240" width="395" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="10" isBold="false" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.Integer"><![CDATA[$P{cursoPlanificado_numero_inscritos}]]></textFieldExpression>

</textField>

<staticText>

<reportElement positionType="Float" x="0" y="155" width="515" height="20"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[NÓMINA DE INSCRITOS]]></text>

</staticText>

<line>

<reportElement positionType="Float" x="402" y="100" width="105" height="1"/>

<graphicElement/>

</line>

<rectangle>

<reportElement x="0" y="265" width="515" height="15" forecolor="#333333" backcolor="#333333"/>

<graphicElement/>

</rectangle>

<textField pattern="dd-MMM-yyyy">

<reportElement positionType="Float" x="402" y="85" width="105" height="15"/>

<textElement textAlignment="Center" verticalAlignment="Middle"/>

<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>

</textField>

<staticText>

<reportElement positionType="Float" x="402" y="100" width="80" height="15"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[Responsable:]]></text>

</staticText>

<staticText>

<reportElement mode="Opaque" x="0" y="265" width="25" height="15" forecolor="#ffffff" backcolor="#333333"/>

<textElement textAlignment="Center">

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[No.]]></text>

</staticText>

<staticText>

<reportElement mode="Opaque" x="25" y="265" width="120" height="15" forecolor="#ffffff" backcolor="#333333"/>

<textElement textAlignment="Center">

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[Especialidad]]></text>

</staticText>

<staticText>

<reportElement mode="Opaque" x="335" y="265" width="80" height="15" forecolor="#ffffff" backcolor="#333333"/>

<textElement textAlignment="Center">

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[Céd./Pas.]]></text>

</staticText>

<staticText>

<reportElement mode="Opaque" x="415" y="265" width="100" height="15" forecolor="#ffffff" backcolor="#333333"/>

<textElement textAlignment="Center">

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[Factura]]></text>

</staticText>

<staticText>

<reportElement mode="Opaque" x="145" y="265" width="190" height="15" forecolor="#ffffff" backcolor="#333333"/>

<textElement textAlignment="Center">

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[Nombre]]></text>

</staticText>

</band>

</pageHeader>

<detail>

<band height="20">

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="25" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="145" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="335" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="415" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="FixRelativeToBottom" x="0" y="19" width="515" height="1" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="514" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="1" height="20" forecolor="#808080"/>

<graphicElement/>

</line>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="25" y="4" width="120" height="15"/>

<textElement verticalAlignment="Middle">

<font reportFont="Arial_Normal" fontName="Times New Roman" size="8" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{inscrito.especialidadString}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="335" y="4" width="80" height="15"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="10" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{inscrito.identificacion}]]></textFieldExpression>

</textField>

<textField>

<reportElement x="0" y="4" width="25" height="15"/>

<textElement>

<font size="10"/>

</textElement>

<textFieldExpression class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="145" y="4" width="190" height="15"/>

<textElement>

<font fontName="Times New Roman" size="8" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{inscrito.nombreCompleto}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="415" y="4" width="90" height="15"/>

<textElement textAlignment="Center">

<font fontName="Times New Roman" size="10" isBold="false" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{numeroFacturaString}]]></textFieldExpression>

</textField>

</band>

</detail>

<pageFooter>

<band height="60">

<rectangle>

<reportElement positionType="Float" mode="Transparent" x="250" y="4" width="250" height="25"/>

<graphicElement/>

</rectangle>

<staticText>

<reportElement positionType="Float" x="252" y="6" width="55" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[FIRMA:]]></text>

</staticText>

<line>

<reportElement positionType="Float" x="325" y="4" width="1" height="25"/>

<graphicElement/>

</line>

<line>

<reportElement positionType="FixRelativeToBottom" x="1" y="30" width="515" height="1"/>

<graphicElement/>

</line>

<elementGroup>

</elementGroup>

<textField pattern="HH:mm:ss a">

<reportElement positionType="Float" x="0" y="45" width="80" height="15"/>

<textElement>

<font size="8" pdfFontName="Courier"/>

</textElement>

<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="0" y="30" width="80" height="15"/>

<textElement>

<font fontName="Arial" size="8" pdfFontName="Courier"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{usuario}]]></textFieldExpression>

</textField>

</band>

</pageFooter>

</jasperReport>

===========================================

Thank you.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...