Eu tenho o seguinte erro ao executar o seguinte comando, tenho todas as bibliotecas e o ireport plugin, você pode me ajudar?
Mensaje de Error:Error loading object from file : C:\Users\User\Documents\NetBeansProjects\impresiononnix\src\impresiononnix\escarapela.jrxml
conexion db = new conexion();
String archivo=“C:\Users\User\Documents\NetBeansProjects\impresiononnix\src\impresiononnix\escarapela.jrxml”;
try{
JasperReport reporte= (JasperReport) JRLoader.loadObjectFromLocation(archivo);
Map parametro= new HashMap();
parametro.put("cedula", "1059786460");
JasperPrint jp= JasperFillManager.fillReport(reporte,parametro,db.MySQLConnect());
JasperViewer jviewer= new JasperViewer(jp,false);
jviewer.setTitle("Escarapela");
jviewer.setVisible(true);
}
catch(JRException ex){
System.out.println("Mensaje de Error:"+ex.getMessage());
}
1 curtida
segue o código abaixo:
AcessoBD acessoBd = new AcessoBD();
if (ftfIdLote.getValue() == null){
JOptionPane.showMessageDialog(this,"Informe o ID do Lote","Erro",JOptionPane.INFORMATION_MESSAGE);
ftfIdLote.requestFocus();
}else {
JOptionPane.showMessageDialog(this,"Aguarde Enquanto é gerado","Impressão",JOptionPane.INFORMATION_MESSAGE);
try {
HashMap parametros = new HashMap();
parametros.put("ID_LOTE",ftfIdLote.getValue());
parametros.put("CAMINHO_IMAGEM1", System.getProperty("user.dir") + "\\imagem\\logocidade.jpg");
parametros.put("CAMINHO_IMAGEM2", System.getProperty("user.dir") + "\\imagem\\logoserf.jpg");
parametros.put("CAMINHO_IMAGEM3", System.getProperty("user.dir") + "\\imagem\\logoprefeitura.jpg");
JasperPrint jp = JasperFillManager.fillReport(System.getProperty("user.dir") + "\\relatorios\\DespachoLote.jasper", parametros, acessoBd.conectar());
JasperViewer.viewReport(jp, false);
//JasperPrintManager.printReport(jp, false);
//JasperPrintManager.printPage(jp,0,false);
this.dispose();
Menu.menuVisivel();
//JasperPrintManager.printReport(jp, false);
} catch (JRException ex) {
Logger.getLogger(RelatorioDespachoLoteFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}