This discussion is archived
5 Replies Latest reply: Oct 4, 2013 5:06 AM by newbi_egy RSS

Composite Search

newbi_egy Explorer
Currently Being Moderated

11gxe , apex 4.x

hi all ,

i created an interactive report , and i want to search in it through two text items and a button , so i created the two text items and the button ,

i want , when i click on the button , the report is updated with the data which satisfy the condition ,

for example :

 

the report for employees in the emp table ,

the text items are (ename,job) ,

- i enter "SMITH" IN THE "ENAME" FIELD , AND "CLERK" in the job field ,

the report displays the data of all employees named "SMITH" AND all employees working as "CLERK" .

 

I have looked at the default interface of the interactive report which has a text item and a button to search , but i could not figure how it is done , and

could not get into the code used ? how to see the code used and the way the task created ? ?

 

??

thanks

  • 1. Re: Composite Search
    vincent_deelen Pro
    Currently Being Moderated

    Hi,

     

    You need two page items Pxx_ENAME and Pxx_JOB. You'll need to include them in the where clause of your query:

     

    select *

    from   emp

    where ename = nvl(:Pxx_ENAME, ename)

    or       job       = nvl(:Pxx_JOB, job)

     

    Next you need a button to set the session state for the page items and to refresh your interactive report. A submit button might be the simplest solution.

     

    Kind regards,

     

    Vincent Deelen

  • 2. Re: Composite Search
    newbi_egy Explorer
    Currently Being Moderated

    you need a button to set the session state for the page items

    i am sorry , i do not understand the expression "session state" for the page items ? what does it mean ?

     

    and to refresh your interactive report

    is it possible to refresh specific item or region or button in the page -- just the item not all the page ??

     

    A submit button might be the simplest solution.

    i am also sorry , i have a conflict in my head because of the "Submit" operation , i really do not know what it is ?

    is it sending a request of "save,update,or delete" operations to the servers , or it means somthing else or something in addition ??

     

    thank you

  • 3. Re: Composite Search
    vincent_deelen Pro
    Currently Being Moderated

    Hi,

     

    Submit is indeed sending a request to the server. When you enter a value in a text field and then submit your page, the value will be stored in session state,which is a referece of all stored text fields during your current session (the period you are logged in to your application). You can use these stored values for reference in one page, or a cross pages in your application.

    It is indeed possible to refresh only part of your page, say a region or a single field. It does however, cost a bit more work and understanding of apex. Given that you are new and familiarizing with apex, I'd wait with that for a bit.

    Here you can find a picture of how your page layout should look with your page items and your button:

    http://vincentdeelen.com/images/otn/iareport_page_layout.png

     

    Good luck.

  • 4. Re: Composite Search
    Gus C Journeyer
    Currently Being Moderated

    Does this really need to be an interactive report.

    If you use a standard sql report, then you can just enable search to yes, in the wizard.

     

    Gus

  • 5. Re: Composite Search
    newbi_egy Explorer
    Currently Being Moderated

    If you use a standard sql report, then you can just enable search to yes, in the wizard.

    if i do so , can i then search with multiple text items , or just depending on one text item ? ?

Legend

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