JasperReport:net.sf.jasperreports.engine.JRException

时间:2014-07-31 17:21:53

标签: java

外线:

net.sf.jasperreports.engine.JRException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException

我用

Netbeans 7.2的Netbeans 7.2 + iReport插件(iReport4.7.1) 使用该插件适用于netbeans,但在运行问题时 库:

  • 的JasperReports-4.7.1.jar
  • 公地BeanUtils的-1.8.2.jar
  • 公地编解码器-1.6.jar
  • 公地集合-3.2.1.jar
  • 公地消化器-1.7.jar
  • commons-logging 1.1.jar
  • 的JasperReports-4.7.1.jar

代码:

try{
                String rutaReport = "src\\PckReports\\rBoleta.jasper";
                Map param = new HashMap();
                param.put("numComprobante",txtCorrelativo.getText());
                param.put("numSerie",txtSerie.getText());
                param.put("tipoComprobante", bol);
                param.put("numLetra",letra);
                JasperReport lReporte = JasperCompileManager.compileReport(rutaReport);
                //JasperReport lReporte = JasperCompileManager.compileReport("PckReports\\rBoleta.jrxml");
                JasperPrint jasp = JasperFillManager.fillReport(lReporte, param, this.jcn.Con());
                //JasperExportManager.exportReportToPdfFile(jasp, "D:\\InformePaisesMySQL.pdf");
                JasperViewer ventana = new JasperViewer(jasp,false); 
                ventana.setTitle("Boleta de Venta -"+fechaEmisionBol());
                ventana.setVisible(true);
            }catch(HeadlessException | JRException ex){
                JOptionPane.showMessageDialog(null, ex);
                System.out.println(""+ex);
            }

1 个答案:

答案 0 :(得分:0)

您可能正在尝试将Jasper二进制文件(rBoleta.jasper)编译为Jasper(XML)源。

尝试

 String rutaReport = "src\\PckReports\\rBoleta.jrxml";
 JasperReport lReporte = JasperCompileManager.compileReport(rutaReport);