como poner imagen de fondo en reporte de JasperReport ?
Hola, estoy modificando un reporte hecho en Jasper *.jrxml, quiero ponerle una imagen de fondo, la imagen debe abarcar del área de "Detail 1" a "Detail 5", pero no sé como hacerle para indicar que debe abarcar esos 5 'band', ya estuve moviendole al xml del reporte pero no he ecnontrado la manera, el error(o warning) que me arroja es: "Warning: the element position is invalid", esto es porque la imagen esta asignada a un solo 'band' , y no debe sobrepasar la altura de ese 'band', ¿como asignar la imagen al fondo de los 5 band ?.
</band>
</pageHeader>
<detail>
<band height="83">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="288" y="62" width="280" height="19"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["México, D.F. a " + new SimpleDateFormat("d 'de' ", new Locale("es")).format(new Date())
+ new SimpleDateFormat("MMMM", new Locale("es")).format(new Date()).substring(0, 1).toUpperCase()
+ new SimpleDateFormat("MMMM 'de' yyyy", new Locale("es")).format(new Date()).substring(1)]]></textFieldExpression>
</textField>
<textField>
<reportElement x="366" y="1" width="202" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{oficio}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="288" y="47" width="280" height="15"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<text><![CDATA[CERTIFICADO CON ACUSE DE RECIBO.]]></text>
</staticText>
<staticText>
<reportElement x="288" y="1" width="78" height="14"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<text><![CDATA[Oficio No. ]]></text>
</staticText>
<staticText>
<reportElement x="288" y="15" width="280" height="32"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<text><![CDATA[Asunto: Se acepta desistimiento de titularidad de Concesión]]></text>
</staticText>
</band>
<band height="76">
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="1" width="569" height="75"/>
<textElement textAlignment="Justified" markup="html">
<font fontName="DejaVu Sans" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{ENCABEZADO}]]></textFieldExpression>
</textField>
<image>
<reportElement x="76" y="1" width="413" height="399"/>
<imageExpression><![CDATA["/home/user/SIM/MainApp/core/src/main/jasperreports/images/Aguila.png"]]></imageExpression>
</image>
</band>
<band height="101" splitType="Stretch">
<textField>
Muchas gracias
Adjunto | Tamaño |
---|---|
Pantalla1.jpg | 148.88 KB |
Pantalla2.jpg | 157.46 KB |
- Inicie sesión o regístrese para enviar comentarios
Resuelto
Este es parte del código:
<band height="700">
<image scaleImage="RetainShape" hAlign="Center" vAlign="Middle">
<reportElement x="74" y="167" width="421" height="404"/>
<imageExpression><![CDATA["/home/user/SIAM/SIAM/MainApp/core/src/main/jasperreports/images/Aguila.png"]]></imageExpression>
</image>
</band>
</background>
<pageHeader>
<band height="134" splitType="Stretch">
<image scaleImage="FillFrame">
<reportElement x="0" y="0" width="270" height="93"/>
<backgorund>
Crea una nueva hoja en el área de diseño de reportes y lo que se ponga ahí va a aparecer en todas las hojas de ese reporte.Saludos.