Pessoal fiz a rotina abaixo, porem ele nao mostra no browser o relatorio e nem da erro no servidor.
Obs. com o JASPER , abre normal o relatorio .
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
InputStream reportStream = context.getExternalContext()
.getResourceAsStream("/relatorios/guiaservico.jasper");
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
PrintWriter printWriter = response.getWriter();
JRHtmlExporter htmlExporter = new JRHtmlExporter();
response.setContentType("text/html");
response.setCharacterEncoding("ISO-8859-1");
request.getSession().setAttribute(
ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,
jp);
htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT,
jp);
htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER,
printWriter);
htmlExporter.setParameter(JRExporterParameter.CHARACTER_ENCODING,
"ISO-8859-1");
/*
* aqui é mapeado para o servlet do JasperReport, para que ao gerar o
* html não renderize as imagens em branco, pois os espaços em branco,
* são imagens em branco que ele adiciona!
* Basta adicionar no web.xml a chamada ao servlet que existe no pacote:
*
<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/image.servlet</url-pattern>
</servlet-mapping>
*
*/
htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,
request.getContextPath() + "/image.servlet?image=");
htmlExporter.exportReport();