Forum Stats

  • 3,839,096 Users
  • 2,262,451 Discussions
  • 7,900,858 Comments

Discussions

Is there a way to load region (classic report ) only on button?

Nabin Maharjan
Nabin Maharjan Member Posts: 7 Red Ribbon
edited Apr 28, 2018 3:13AM in APEX Discussions

Hi,

I am not able to load/render report (classic report) on button click. Is there a way to do this? i am able to render static/htm content of region with process through ajax.

Please any help.

Regards,

Nabin

Tagged:
Nabin MaharjanMD. MASUD

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    Answer ✓
    Nabin Maharjan wrote:report content 

    1. Create a hidden and protected page item PX_VISIBLE with default value "0".

    2. Add a predicate to the report query that will stop it returning rows until the value of this item = "1":

    select    ...from    ...where    ...and coalesce(:px_visible, '0') = '1'

    3. Add PX_VISIBLE to the report region Page items to Submit property.

    4. Set the button action to Defined by Dynamic Action.

    5. Create a Click dynamic action on the button:

    Event: Click

    Selection Type: Button

    Button: <your button>

    Action: Set Value

    Fire On Initialization: No

    Set Type: Static Assignment

    Value: 1

    Suppress Change Event: No

    Selection Type: Item

    Item: PX_VISIBLE

    6. Create a Change dynamic action on the PX_VISIBLE hidden item:

    Event: Change

    Selection Type: Item

    Item: PX_VISIBLE

    Client-side Condition: Item = Value

    Item: PX_VISIBLE

    Value: 1

    Action: Refresh

    Selection Type: Region

    Region: <report region>

    Fire On Initialization: No

    Nabin MaharjanNabin MaharjanMD. MASUD

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    edited Apr 24, 2018 2:46AM
    Nabin Maharjan wrote:I am not able to load/render report (classic report) on button click. Is there a way to do this? i am able to render static/htm content of region with process through ajax.

    It depends. Are you referring only to the report content, or the entire report region?

  • Nabin Maharjan
    Nabin Maharjan Member Posts: 7 Red Ribbon
    edited Apr 24, 2018 11:22AM

    any (report content or report region).

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    edited Apr 24, 2018 11:49AM
    Nabin Maharjan wrote:any (report content or report region). 

    Pick the option you prefer.

  • Nabin Maharjan
    Nabin Maharjan Member Posts: 7 Red Ribbon
    edited Apr 25, 2018 5:07AM

    report content

  • ToolTimeTabor
    ToolTimeTabor Member Posts: 279 Blue Ribbon
    edited Apr 25, 2018 8:04AM

    Nabin,

    Depending upon the content quantity and performance levels, you could add your region to the page, populate the region using whatever technique you prefer, then use a Page Load event to trigger a Dynamic Action to "hide" the region.  Then, in your button's dynamic action, you could "show" that region.

    Rob

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    Answer ✓
    Nabin Maharjan wrote:report content 

    1. Create a hidden and protected page item PX_VISIBLE with default value "0".

    2. Add a predicate to the report query that will stop it returning rows until the value of this item = "1":

    select    ...from    ...where    ...and coalesce(:px_visible, '0') = '1'

    3. Add PX_VISIBLE to the report region Page items to Submit property.

    4. Set the button action to Defined by Dynamic Action.

    5. Create a Click dynamic action on the button:

    Event: Click

    Selection Type: Button

    Button: <your button>

    Action: Set Value

    Fire On Initialization: No

    Set Type: Static Assignment

    Value: 1

    Suppress Change Event: No

    Selection Type: Item

    Item: PX_VISIBLE

    6. Create a Change dynamic action on the PX_VISIBLE hidden item:

    Event: Change

    Selection Type: Item

    Item: PX_VISIBLE

    Client-side Condition: Item = Value

    Item: PX_VISIBLE

    Value: 1

    Action: Refresh

    Selection Type: Region

    Region: <report region>

    Fire On Initialization: No

    Nabin MaharjanNabin MaharjanMD. MASUD
  • Nabin Maharjan
    Nabin Maharjan Member Posts: 7 Red Ribbon
    edited Apr 28, 2018 1:26AM

    thank you appreciated.... i add one more process after region that sets px_visible to 0, so it will be same when you reload/refresh the page.

  • Aminul_Islam
    Aminul_Islam Member Posts: 1
    edited Apr 28, 2018 3:13AM
This discussion has been closed.