Olá,
nunca usei esse comando JasPerView e não sei porque não sai na tela o report …
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
String acao = req.getParameter("acao");
System.out.println("acao="+acao);
Class clazz = Class.forName("br.com.relatorio.action." + acao + "Action");
Action action = (Action) clazz.newInstance();
String Mapping = action.execute(req,resp);
rd = req.getRequestDispatcher(Mapping);
rd.forward(req,resp);
}catch(Exception e){
System.out.println("Erro na Action ="+e.getMessage());
}
---
parameters.put("tipo_grupo", Long.valueOf(request.getParameter("tipo_grupo")));
parameters.put("imagem_dir", host+locationImage);
String jasper = request.getContextPath()+ "/reports/ImsGrupo001.jasper";
URL jasperURL = new URL(host + jasper);
System.out.println("Getting the binary...");
JasperReport relatoriosJasper = (JasperReport)JRLoader.loadObject("D:/workspace_patt/Relatorio/WebContent/reports/Grupo001.jasper");
JasperPrint jasperPrint = JasperFillManager.fillReport(relatoriosJasper, parameters, con);
JasperViewer jrViewer = new JasperViewer(jasperPrint, true);