Estoy probando mi primer ejemplo en jasperReport, pero al ejecutar el archivo .java me da el siguiente error:
nov 14, 2014 1:30:35 PM net.sf.jasperreports.engine.xml.JRBandFactory createObject
Advertencia: The 'isSplitAllowed' attribute is deprecated. Use the 'splitType' attribute instead.
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Byte no válido 1 de la secuencia UTF-8 de 1 bytes
El código del archivo HolaMundo.jrxml es este:
Código:
<?xml version="1.0" ?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="200">
<detail>
<band height="200">
<staticText>
<reportElement x="0" y="0" width="500" height="20"/>
<text><![CDATA[Informe ¡Hola Mundo!]]></text>
</staticText>
</band>
</detail>
</jasperReport>
El código de Main.java es este:
Código:
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String reportSource="./reports/templates/HolaMundo.jrxml";
String reportDest="./reports/results/HolaMundo.html";
Map <String, Object> params=new HashMap <String, Object>();
try
{
JasperReport jasperReport=JasperCompileManager.compileReport(reportSource);
JasperPrint jasperPrint=JasperFillManager.fillReport(
jasperReport, params, new JREmptyDataSource());
JasperExportManager.exportReportToHtmlFile(
jasperPrint, reportDest);
JasperViewer.viewReport(jasperPrint);
}
catch (JRException ex)
{
System.out.println(ex.getMessage());
}
}
}
He quitado el caracter ¡, pero sigue sin generarme el informe. No se muy bien qué es lo que sucede.
Espero que me podáis ayudar, gracias de antemano.
Saludos