0 Replies Latest reply on May 13, 2010 11:55 AM by naresh vatsal

    Jasper report integration problem Unknown hyperlink target 0

    naresh vatsal Newbie
      Hi,

              public void runAllNodeReport() {
                      try {
                          Map parameters = new HashMap();
                          parameters.put("Title", "The All Node Report");
                             
                         // JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(getResultList());
                          byte[] bytes = JasperRunManager.runReportToPdf(this.getClass().getResourceAsStream("/All_node.jasper"), parameters);
                         
                          HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse();
                          response.setContentType("application/pdf");
                          response.addHeader("Content-Disposition","attachment;filename=AllNode.pdf");
                          response.setContentLength(bytes.length);
                          ServletOutputStream servletOutputStream = response.getOutputStream();
                          servletOutputStream.write(bytes, 0, bytes.length);
                          servletOutputStream.flush();
                          servletOutputStream.close();
                          FacesContext.getCurrentInstance().responseComplete();
                      } catch (JRException jre) {
                              jre.printStackTrace();
                      } catch (IOException e) {
                              e.printStackTrace();
                      }
              }

      when i am calling this runAllNodeReport() in xhtml page.On clicking button.
      I am getting exception.
      net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0

      Can anyone give me suggestion. I am deploying my application as ear.
      I have put .jasper template in the package where my ActionBean .