Jump to content
We've recently updated our Privacy Statement, available here ×

tomdes

Members
  • Posts

    3
  • Joined

  • Last visited

tomdes's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I don't know if this is the solution for your problem but I had simular problems. Place your jasper file in the web/WEB-INF folder en call the file from there. Included my code for a servlet (not to PDF file but to browser). Code:protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { ServletOutputStream servletOutputStream = null; servletOutputStream = response.getOutputStream(); File reportFile = new File(getServletConfig().getServletContext().getRealPath("/WEB-INF/factuurzonderlijnen.jasper")); byte[] bytes = null; bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), aanmakenParameters(fp),new HashMap(), new JREmptyDataSource()); response.setContentType("application/pdf"); response.setContentLength(bytes.length); servletOutputStream.write(bytes, 0, bytes.length); servletOutputStream.flush(); servletOutputStream.close(); } catch (Exception e) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); response.setContentType("application/pdf"); response.getOutputStream().print(stringWriter.toString() + e.toString()); } }
  2. Thank you for your awnser. I tried what you said but it doesn't work. I placed my subreport in a footer (tried page and column footer) and it still shows only one page. To make my case more clear: I have a reportX that has 3 pages when I print it. That is no problem. Now I want to print for example 10 reportX reports in one PDF file. So what I did was make a ParentReport with a subreport (>reportX) that is spread all over the ParentReport. When I print the ParentReport, only the first page of each reportX is printed. Hope this is more clear than my previous explanation.
  3. Hey, I have a report with a subreport that is spread all over the report (subreport is 100% in <detail>). My subreports counts multiple pages. When i print the report, only one page of the subreport is printed each time. Is there a way to print a subreport that counts multiple pages? Any ideas are welcome. Thanks in advance.
×
×
  • Create New...