0
I am trying to pass a List by parameter to my Sub Report, but when it arrives in a certain part the application to and the report is not generated. Never get out of it:
I’m passing the list that way:
public boolean gerarRelatorio(List list, int numeroRelatorio, String nomePrestador, String dataSistema) {
JasperReport report = null;
InputStream image = 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 stops without any errors?