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

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.

Related

Clear Page Item in Oracle Apex

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.

Limiting rows initially returned in select list

Populating an Apex 5.1 select list of employees with about 25,000 names is proving to be a performance problem when loading the page. Is there a method of limiting the initial list to a set number (such as 200), and dynamically populating with chunks of additional names as the user scrolls through the list? Are there other options I should consider that would not slow down the page load?
I am currently using a dynamic LOV, and have tried adjusting this LOV to include Oracle row limiting code; however, there is no way of fetching past the initial set of rows. The source of the data is a view on a materialized view.
I appreciate any ideas
I'd use a pop-up LOV with a search function, not showing any records until the user enters a search value (more than 3 characters). I know it's tedious to use a pop-up LOV but it seems the only way to prevent waiting for a slow list to display.
I'd try with cascading lists of values. I don't know what those 25.000 names represent, but - suppose it is a large company. Then you'd
1st LoV: continent
2nd Lov: country
which refers to the previous LoV as where country.continent = :P1_CONTINENT
3rd LoV: city
which refers the previous LoV as where city.coutry = :P1_COUNTRY
4rd Lov is actually your current query:
which refers to the previous Lov as where person.city = :P1_CITY
Now your list of values wouldn't contain 25.000 rows, but - hopefully - a lot less.

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).

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.

Visual Studio 2005 table rendering order

I'm working in Visual Studio 2005 Reporting and I'm trying to implement a workaround of nesting aggregate functions (I need to perform a Count of Sums). In the table details row, I have a call to custom code to increment an integer every time the value of one cell is >10, then the footer has a call to a custom code function that just returns that value.
The count was always returned as 0, so I threw in some MsgBox calls and noticed the table footer is being called before the details rows. I need the table details rows to be called first so that the "get" function in the footer will actually retrieve the value I need.
To be more specific, I'm looking to count the number of times a given table cell, whose value is calculated as (Sum / (Sum+Sum+Sum)) * 100, is greater than 10. Since aggregate functions can't be nested, and the use of aggregates on ReportItems!... can only be done in report headers/footers (in my case not helpful as it will display a different total on each page), I'm left with the option of custom code.
Is there any way to force the details row of a table to be rendered before the table footer?
Instead of using the table footer, I used a textbox beneath the table, so the table was rendered first, header and details rows, then the report processed the textbox below, leading to the correct value.
Hope that helps anyone that comes across this issue.

Resources