Forum Stats

  • 3,851,489 Users
  • 2,263,988 Discussions
  • 7,904,739 Comments

Discussions

Display Conditional interactive report

Manas M
Manas M Member Posts: 15
edited Mar 27, 2014 4:13AM in APEX Discussions

I have a radio button group with two options:

1. Display records from X table

2. Display records from Y table

And a Display button

Depending on the user selection of the radio button(Say option 1)the user will them click the Display button and then i want my Interactive report to be displayed (in this case Records from X table).

If the user selects the second option and clicks on the Display button then Interactive report to be displayed (in this case Records from Y table).

Please help me solve this problem.  I am new to Oracle apex.

Thanks in advance.

Best Answer

  • Salai Kumar
    Salai Kumar Member Posts: 18 Blue Ribbon
    Answer ✓

    You can handle this with two select statement. Here is the logic

    select * from table where 1= :RADIO_PAGE_ITEM

    union

    select * from table where 2= :RADIO_PAGE_ITEM and your  condition

    Note : Your option 1  should return 1 so first select statement will get executed in this case second statement is failed and vice versa.

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,196 Red Diamond
    edited Mar 27, 2014 2:35AM
    Manas M wrote:
    
    I have a radio button group with two options:
    1. Display records from X table
    2. Display records from Y table
    
    And a Display button
    
    Depending on the user selection of the radio button(Say option 1)the user will them click the Display button and then i want my Interactive report to be displayed (in this case Records from X table).
    
    If the user selects the second option and clicks on the Display button then Interactive report to be displayed (in this case Records from Y table).
    
    Please help me solve this problem.  I am new to Oracle apex.
    
    

    Why are you trying to display rows from different tables in one interactive report?

    Do the tables have the same column structure? If so, why do they exist as separate tables?

  • Manas M
    Manas M Member Posts: 15

    Hello fac586,

    Thanks for your response.

    Actually my requirement is to display data from the same table but with a condition. It's just for an example sake I spoke of two tables

    When the user selects option 1 i need to display all records from table X.

    and when the user selects option 2 I need to display records from table X with a where condition.

    So basically I need an PL/sql block where I can mention this IF condition. But interactive reports do no allow me this.

    Please suggest be as to how do i go about this.

    Thanks

  • Salai Kumar
    Salai Kumar Member Posts: 18 Blue Ribbon
    Answer ✓

    You can handle this with two select statement. Here is the logic

    select * from table where 1= :RADIO_PAGE_ITEM

    union

    select * from table where 2= :RADIO_PAGE_ITEM and your  condition

    Note : Your option 1  should return 1 so first select statement will get executed in this case second statement is failed and vice versa.

  • AlexAA
    AlexAA Member Posts: 173 Bronze Badge
    edited Mar 27, 2014 3:25AM

    Hi, Manas

    As you wrote

    Actually my requirement is to display data from the same table but with a condition. It's just for an example sake I spoke of two tables
    
    When the user selects option 1 i need to display all records from table X.
    and when the user selects option 2 I need to display records from table X with a where condition.
    
    
    

    You can use for this purpose IR without radio group. Use standart IR functionality. Check this links

    9.3 Customizing Interactive Reports

    Save Options by User Type

    Create report, set filters and save as public report. Let user select report that he need.

    AlexAA
  • fac586
    fac586 Senior Technical Architect Member Posts: 21,196 Red Diamond
    Manas M wrote:
    
    Actually my requirement is to display data from the same table but with a condition. It's just for an example sake I spoke of two tables
    

    Unfortunately a bad example.

    Interactive reports based on dynamic data sources hold an unnatural attraction for many people, despite Oracle saying that it's simply not feasible. Asking about an IR based on two tables looked like another such request. Now that you've identified the real problem, you've been provided with two different solutions very quickly.

    This forum is plagued by people asking XY Questions. Given a requirement, people fix on the first potential solution they think of, fail to implement it, and then ask questions about the problems they are having with that implementation, rather than asking how to meet the original requirement. Avoid this trap. Good questions get answered quickly and effectively.

This discussion has been closed.