Thursday, May 17, 2012

Call Oracle Reports From Your ADF Application (Hide Report Parameters From URL)

Hello ADF Developers,

In my previous post http://sameh-nassar.blogspot.com/2010/07/call-oracle-reports-from-your-adf.html I explain a way to call oracle report but this way has a problem. The problem is the report parameters appear in the URL. In this post I will explain another way to call oracle report without displaying report parameters in URL.
to call oracle report follow this steps:
1- Make a new .jsp page (for example the page name is  report.jsp).

2- In faces-config.xml make a navigation rule to report.jsp with outcome "report".

3- Write this code inside the report.jsp page






4- Create ADF page (.jspx or .jsf page) then add button (this button will call the report) and in the button action write this code:

    





15 comments:

  1. great post , sameh
    yours
    amr ismail

    ReplyDelete
  2. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Alena

    Diverticulitis Treatment Diverticulitis Diet

    ReplyDelete
  3. Thank you , Sameh
    Very nice topic.

    Mahmoud Ahmed

    ReplyDelete
  4. Sameh Thank you very much for post it works perfectly. I have a question though, how to open the report in a new page or tab and not the same one as the application.
    Any help please

    ReplyDelete
    Replies
    1. Hi Mohamed,
      you can add a af:clientListener inside the button call a script method. as :

      af:commandButton text="runReport" id="cb1">
      af:clientListener method="newWindow" type="action"/>


      newWindow is a script method like:
      function newWindow()
      {
      document.getElementById("yourFormId").target = "_blank;targetfeatures=toolbar=no location=no directories=no menubar=no";
      }
      Regards

      Delete
    2. where to write this function code?

      Delete
  5. I must appreciate your post which is helping us in such a great manner.
    free 0800 numbers

    ReplyDelete
  6. hi thanks for u post
    i have question for

    how call rdf from jsf not jsp ?

    ReplyDelete
    Replies
    1. Hi,
      jsp is just page for calling report. Your main pages is .jsf but you have only one .jsp for just calling the report

      Delete
  7. Can use this toturial in JSPX page?

    ReplyDelete
    Replies
    1. Your ADF application will has .jspx, .jsf, .jsff pages no problems, but the created jsp page just for calling oracle report

      Delete
    2. Good Work Sameh,
      Is there a way to path the report server name through the map

      Delete
    3. You can put server url in a variable in sessionScope and you can read this variable in report.jsp page as:
      - In the button action after you create a map and put it in sessionScope you can add this
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("serverUrl", "write_server_Url");
      - In report.jsp get this variable from session as:
      form action=${sessionScope.serverUrl} method="post" id="form1"

      Delete