Thusira Dissanayake
Thusira Dissanayake

Reputation: 153

Oracle APEX filter change dynamically in saved reports

I have an IR with saved reports where filters has been added to the column Year = 2015. I need to write a plsql procedure to update the Year filter to Year = 2016. How can i achieve such a scenario. I looked in to the API and it didn't give me any thing. the only option i can come up with is changing data manually in the DB. below is the query i used to get the saved private reports.

SELECT  a.flow_id,a.page_id,a.status,a.application_user,a.name, b.interactive_report_id, c.condition_type,c.column_name,c.operator,c.expr
FROM apex_040000.wwv_flow_worksheet_rpts a, apex_application_page_ir b, apex_040000.WWV_FLOW_WORKSHEET_CONDITIONS c
WHERE a.flow_id = :APP_ID
AND a.page_id = b.page_id
AND b.application_id = a.flow_id
AND a.worksheet_id = b.interactive_report_id
AND a.status = 'PRIVATE'
AND c.report_id = a.id
AND c.column_name='YEAR'
and a.page_id= :APP_PAGE_ID

Would i be able to succeed wth this approach. Is there any other solution for this. ?

Upvotes: 1

Views: 1642

Answers (1)

hinotf
hinotf

Reputation: 1138

You can try apex_util.ir_clear(p_page_id => 200001) to clear all filters and other settings (only sort and column visibility remains) or apex_util.ir_reset(p_page_id => 200001) to reset your current report to Primary report. And then apex_util.ir_filter to set new filter. This actions not literally modify your saved report, but changes it's current setting. At next time saved report will be same as before clear or reset.

Upvotes: 1

Related Questions