I'm trying to pass a list by parameter to my Sub Report, however when it arrives in certain part the application stops and the report is not generated. It never goes away:
I'mpassingtheListthisway:
publicbooleangerarRelatorio(Listlist,intnumeroRelatorio,StringnomePrestador,StringdataSistema){JasperReportreport=null;InputStreamimage=this.getClass().getResourceAsStream("/br/com/xml/relatorio/LOGO.png");
filtro.put("Image", image);
filtro.put("listaDados", listaProcedimentos);
filtro.put("localizarRel", "src/br/com/xml/relatorio/subRelatorio.jasper");
try {
InputStream inputStreamReal = getClass().getResourceAsStream("/br/com/xml/relatorio/Relatorio3.jrxml");
report = JasperCompileManager.compileReport(inputStreamReal);
} catch (JRException ex) {
Logger.getLogger(frmPegaXml.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(null, "Erro ao pegar arquivos!", "ERRO!", JOptionPane.ERROR_MESSAGE);
}
try {
JasperPrint print = JasperFillManager.fillReport(report, filtro, new JRBeanCollectionDataSource(list));
JasperExportManager.exportReportToPdfFile(print,
"C:/Demonstrativos/" + dataSistema + "/" + nomePrestador + "_" + dataSistema + "_" + numeroRelatorio + ".pdf");
return true;
} catch (JRException ex) {
Logger.getLogger(frmPegaXml.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(null, "Erro ao Gerar relatório, verifique se nenhum arquivo está aberto ou se o nome está correto!\n" + ex, "ERRO!", JOptionPane.ERROR_MESSAGE);
return false;
}
}
Does anyone know why the application stopped without any errors?