Clear Page Item in Oracle Apex - oracle

I am calling an IR with a link using a hidden page item to filter the IR records. The IR has a search region as well. Now when I click the link, the IR report opens with desired records.
Now as IR is already open and when I try to use the search region LOV to see other records it always shows me records with the previous page item hidden column even though I am changing the LOV.
how can I fix it?
IR query is as below:
(SELECT email_address, status, description FROM recipients
WHERE recipient_group_id = NVL ( :P6_$RECIPIENT_GROUP_ID, recipient_group_id )
AND recipient_id = NVL ( :p8_recipient_id, recipient_id ))
The :P6_$RECIPIENT_GROUP_ID is coming from the previous page from where I am calling the IR using the link column.
The p8_recipient_id is the value coming from the search region of IR.

That is expected behaviour. The page item value for :P6_$RECIPIENT_GROUP_ID will be set until it is reset, either by setting the value to NULL or clearing the cache on page 6 (I'm assuming that is where this page item is defined).
If you want to clear the value of P6_$RECIPIENT_GROUP_ID then define a dynamic action on change of P8_RECIPIENT_ID to set P6_$RECIPIENT_GROUP_ID to NULL. Make sure the interactive report has attribute "items to submit" including both P6_$RECIPIENT_GROUP_ID and P8_RECIPIENT_ID.
Note: referencing a page item from another page is not a good practice. It may lead to unexpected results. A cleaner solution would be to define a P6_$RECIPIENT_GROUP_ID on page 8 and set that from the link to the IR.

Related

Oracle Apex 5.1 (How to add custom link additional to default link on Interactive report)

How to add additional custom link to modal dialogue page from Interactive report in Oracle Apex 5.1
I want to show this link only when flag is Y for specific rows.
What will be the best way to do it...
Create a link (using f?p syntax) as a column in report. As you only want to display it when some condition is met, use CASE (or DECODE), e.g.
select
id,
name,
--
case when flag = 'Y' then 'f?p=&APP_ID.:3:'||&SESSION.||'::NO::P3_POG:4005
else null
end as link,
--
etc.
from your_table
where ...
In this example, I'm calling page #3 and passing 4005 to P3_POG item value.
A better option (as Jeffrey suggested) would be
case when flag = 'Y' then
apex_page.get_url(p_page=>3, p_items=>'P3_POG', p_values=>my_id)
end as link
Don't forget to set escaping special characters property for the LINK column.

Oracle Apex - Links in report row that gets a value from the row and uses it to generate another report on a different page

Oracle Apex 5.1
I have a report (Report A) that has a table of values generated from a SQL query.
How do I get a link column to get a value (e.g. employee_ID) of the current row then send that value to another page that has a report (Report B) that is generated using the value from report A.
New to Apex and a lot of the guide or tutorials seem very convoluted for something that seems like quite a standard thing.
Thanks for any help!
This is a pretty basic thing and there are many examples of it online.
The simplest way is to create a column link (in attributes) which links to your target page containing report B. On the page containing report B have a hidden item (e.g. employee_id) and in your link use the set items area to set PX_employee_id to value #employee_id#. Then on report B have a where clause - where employee_id = :PX_EMPLOYEE_ID (replace X with the relevant page number).

Oracle Apex 5.0: Wait to generate IR until criteria fields entered

I have an APEX 5.0.3.00.03 page with dozens of criteria fields, followed by a region containing an Interactive Report (IR). I want to defer the IR being produced until a "Generate" button is clicked, but I am having troubles. The report without criteria would generate millions of rows, via a nasty 5 table join, so I want to defer it processing until the user is ready. I know that I can do a /*+ FIRST_ROWS */ hint, but still want to avoid invoking the SQL until the user picks some criteria.
I tried the following:
Created a Hidden Field P210_WAIT, initial value of 'TRUE', which I included in the SQL criteria like this:
select * from tab_1, tab_2, tab_3, tab_4, tab_5
where :P210_WAIT != 'TRUE'
and -- join, and dozens of other criteria here
and in a dynamic action on the Generate button, I do two things:
Execupte PL/SQL Code to set :P210_WAIT := 'FALSE';
Refresh Action:
Action: Refresh
Affected elements: Selection Type: Region. Region: (region containing my IR)
I have debug statements in the PL/SQL code, and they are appearing, but the SQL to produce the report is not being run, implying that the Refresh Action is not "waking up" the IR.
It does appear the IR SQL is being executed on page load, as I was dynamically setting the IR Attribute "When No Data Found" value to initially say "Please select criteria and click the Generate button to display report" and that was working.
If I understand your problem correctly, your main problem here would be: the dyanamic action to refresh the region is not working, am i correct?
If that is the problem, try this:
First, make sure that all the bind variables in the source query is listed on the Page Items to Submit under the source query region.
Then, Assign Static ID for the IR region.
Next will be, changing the Refresh dynamic action to Execute Javascript and paste this
$('#static_id').trigger('apexrefresh');
Hope this helps.

Passing more than 3 items in a reports column link

I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!
Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.
Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.
I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.
These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.

Does a report's maximum row count affect the style of pagination in Oracle Application Express (APEX) 3.1?

I am trying to make a report use a drop-down list (select list) for pagination on a report however I have found that if the maximum row count for the report is set to a value above 8000 that APEX will use a pagination style of next and previous links instead. Is this a known bug of Oracle APEX 3.1?
EDIT: Pagination works as expected when the maximum row count is set to a value below 8000.
The root cause of the problem was that the number of rows for each page in the report was statically assigned in a named list of value (VALUE) and tied to the page item.
I then removed that item reference and the select list was used for the pagination scheme!
I have pictures of the pagination scheme settings but my reputation is still too low to post them.

Resources