This discussion is archived
3 Replies Latest reply: May 8, 2012 5:35 AM by 862073 RSS

jasper report integration in Oracle BPM

862073 Newbie
Currently Being Moderated
Hello friends

We'r working on an application using Oracle BPM 11g (

What we are looking for is to have the ability to generate reports using iReport (jasper).

Using help from the previous thread below ,we have been able to call a report without any input parameters and by calling the servlet directly.

Re: generating jasper reports in Oracle BPM

What we're trying to do here is to have some input parameters for our report.
I'm trying to do this using a java class, but haven't found any sample to show me the way and samples I've found didn't work in Oracle BPM

Can anyone help me with this?
Thank you
  • 1. Re: jasper report integration in Oracle BPM
    Sudipto Desmukh Expert
    Currently Being Moderated
    If you need to generated the Jasper report from the ADF UI taskform which is generated from BPM you can follow these -

    Also in case you face simialr issues while inegrating it you can look for the solution here
    generating jasper reports in Oracle BPM
  • 2. Re: jasper report integration in Oracle BPM
    862073 Newbie
    Currently Being Moderated
    Hello Sudipto

    Thank you for your quick reply but that's my own thread as i mentioned in the question section.
    I forgot to mention it at first, I guess your reply came when I was editing my question.
    sorry about that.
  • 3. Re: jasper report integration in Oracle BPM
    862073 Newbie
    Currently Being Moderated
    I have finally solved my problem.
    The problem was that I could not send the input parameter to the servlet.
    Here is my code:

    in my java class:
    public String actionRunReport() throws Exception {
            // Add event code here...
            String emp = null;
            if (getEmployeeID().getValue() != null) {
                emp = getEmployeeID().getValue().toString();
            } else {
                emp = "1";
            FacesContext ctx = FacesContext.getCurrentInstance();
            HttpServletRequest request =
            HttpServletResponse response =
            request.setAttribute("empId", emp);
            return null;
    in my servlet:
    public void doPost(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException,
                                                                IOException {
            //OutputStream ouputStream = null;
            try {
                Connection conn = Connect.createConnection();
                String reportSource = "C:\\reports\\templates\\guarantees.jrxml";
                InputStream input = new FileInputStream(new File(reportSource));
                JasperDesign design = JRXmlLoader.load(input);
                JasperReport report = JasperCompileManager.compileReport(design);
                Map<String, Object> params = new HashMap<String, Object>();
                params.put("reportTitle", "Guarantees");
                params.put("author", "Milad");
                params.put("startDate", (new java.util.Date()).toString());
                params.put("empId", request.getAttribute("empId"));
                JasperPrint jasperPrint =
                    JasperFillManager.fillReport(report, params, conn);
                OutputStream ouputStream = response.getOutputStream();
                JRExporter exporter = null;
                exporter = new JRPdfExporter();
            } catch (Exception ex) {
    In jspx page::
    <af:commandButton text="Run report" id="cb1"
    in web.xml:


  • Correct Answers - 10 points
  • Helpful Answers - 5 points