Pessoal,
Estou tentando exportar para html um relatorio feito no ireport, executo o método abaixo, não dá erro, não mostra exception mas também o relatório não abre, alguém tem alguma idéia?
public void imprimirGuiaHtml(GuiaDependente guia) throws IOException, JRException{
listaGuia=guiaService.listarGuia(guia.getCodigo(), guia.getTipo(), guia.getLote(), guia.getSeqConta());
FacesContext facesContext = FacesContext.getCurrentInstance();
ServletContext scontext = (ServletContext) facesContext.getExternalContext().getContext();
String relatorio = new String(scontext.getRealPath("/WEB-INF/report/Guia_html.jasper"));
HashMap<String, Object> parametros = new HashMap<String, Object>();
parametros.put("pCodigo", guia.getCodigo());
parametros.put("pLote",guia.getLote());
parametros.put("pTipo", "'"+guia.getTipo()+"'");
parametros.put("pConta",guia.getSeqConta());
JRDataSource jrds = new JRBeanCollectionDataSource(listaGuia);
JasperPrint impressao = null;
impressao = JasperFillManager.fillReport(relatorio, parametros,jrds);
// html
try{
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
HttpServletResponse response=(HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
PrintWriter printWriter = response.getWriter();
JRHtmlExporter htmlExporter = new JRHtmlExporter();
response.setContentType("text/html");
request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, impressao);
htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, impressao);
htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER,printWriter);
htmlExporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "ISO-8859-1");
htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, request.getContextPath() + "/image.servlet?image=");
htmlExporter.exportReport();
}catch (Exception e){
e.printStackTrace();
}
}