Pessoal estou com uma duvida de iniciante do JasperReport. Estou tentando gerar o relatório com o Jasper mas não consigo, é gerado 2 erros que variam.
O primeiro erro:
10:27:58,578 FATAL [application] java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.fill.JRVerticalFille
O segundo:
java.lang.ExceptionInInitializerError
Meu método:
[code] public String gerarRelatorioGeralPorInscritos() throws Exception {
inscrito = new Inscrito();
try {
List lista = (List) getInscritos();
DataSourceRelatorio dataSource = new DataSourceRelatorio(lista);
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
InputStream reportStream = context.getExternalContext().getResourceAsStream("/WEB-INF/relatorio/RelatorioGeralPorInscritos.jasper");
response.setContentType(“application/pdf”);
response.setHeader(“Content-disposition”, “attachment;filename=” + “RelatorioGeralPorInscritos” + “.pdf”);
ServletOutputStream servletOutputStream = response.getOutputStream();
HashMap map = new HashMap();
for (Iterator<Inscrito> it = lista.iterator(); it.hasNext();) {
inscrito = it.next();
if ((inscrito != null) && (inscrito.getCodigoInscrito() != 0)) {
map.put("codi_insc", inscrito.getCodigoInscrito());
} else {
map.put("codi_insc", 0);
}
if (!inscrito.getNomeInscrito().equals("")) {
map.put("nome_insc", inscrito.getNomeInscrito());
} else {
map.put("nome_insc", "");
}
if (!inscrito.getNumeroCpf().equals("")) {
map.put("nume_cpf", inscrito.getNumeroCpf());
} else {
map.put("nume_cpf", "");
}
if (!inscrito.getDescricaoSexo().equals("")) {
map.put("desc_sexo", inscrito.getDescricaoSexo());
} else {
map.put("desc_sexo", "");
}
if (!inscrito.getDescricaoEmail().equals("")) {
map.put("descricaoEmail", inscrito.getDescricaoEmail());
} else {
map.put("descricaoEmail", "");
}
}
try {
JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, map, dataSource);
} finally {
context.responseComplete();
servletOutputStream.flush();
servletOutputStream.close();
}
} catch (JRException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return "Sucesso";
}[/code]