hsnakew Posted March 7, 2011 Share Posted March 7, 2011 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 More sharing options...
Raphaël Peguet Posted March 8, 2011 Share Posted March 8, 2011 Hi,You may get more information on what's going on opening the page http://localhost:8080/jasperserver-pro/log_settings.html and changing the log settings to debugNB you may need to change server name and port in the url above.Raphael Link to comment Share on other sites More sharing options...
hsnakew Posted March 8, 2011 Author Share Posted March 8, 2011 Thank you for your contribution.However, do not use the JasperReport server to launch it;I use a tomcat server with a servlet handmade. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now