Jump to content

Help launching subreports from servlet


hsnakew

Recommended Posts

When launching the report from the servlet, and this report contains subreports, simply does not run and throws me no error in the application server console.
The reports that
not include subreports, running smoothly.

Any suggestions on how to resolve the incident?

Code:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)    throws ServletException, IOException {        ServletOutputStream out=response.getOutputStream();        response.setContentType("application/pdf");        String idreporte = request.getParameter("idreporte");        String valor1 = request.getParameter("parametro1");        response.setHeader("Content-Disposition","inline; filename=Diario_de_Ventas.pdf");        new jasper().reporte("diario_de_ventas2.jasper","fecha",valor1,"","",response.getOutputStream());....public void reporte(String archivo, String identificador1, String parametro1,String identificador2, String parametro2, OutputStream out){     JasperReport reporte;     JasperPrint reporte_view;     try{          Map parameters = new HashMap();         parameters.put (identificador1,parametro1);            parameters.put (identificador2,parametro2);          URL  in = this.getClass().getResource(archivo);          reporte = (JasperReport) JRLoader.loadObject( in );          reporte_view= JasperFillManager.fillReport( reporte, parameters, con.getConnection() );           JasperExportManager.exportReportToPdfStream(reporte_view,out);          con.desconectar();   }catch (JRException E){     E.printStackTrace();          }    }
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...