bob dylan
bob dylan

Reputation: 1498

Apex dynamic report based on LOV

I wish to create several reports based upon a list of values - however I want to use the 'LOV.value' returned to dynamically alter the sql run. So instead of having a list of reports e.g.

report1
report2
report3

I want the underlying sql to be something along the lines of:

select * from reportview where reportname = 'LOV.value';

which translate to:

select * from reportview where reportname = 'report1'; /
select * from reportview where reportname = 'report2'; / 
select * from reportview where reportname = 'report3';

depending on which option was chosen.

Is this possible? If so how can I do this?

Note: Yes the sql would always valid.

Upvotes: 2

Views: 1426

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132750

You can use the item that has the LOV in the query:

select * from reportview where reportname = :P123_REPORT_NAME;

Here P123_REPORT_NAME is the name of a page item e.g. a select list, that has the LOV that returns report1-3 associated with it. You can use the item settings to make APEX submit the page when the value is changed, if you wish.

For a pop-up LOV there is no "submit when value changed" setting. Instead you can create a dynamic action that fires when the item is changed and submits the page.

Upvotes: 1

Related Questions