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

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

Related

In oracle apex how to navigate to different pages from link column depending on another column data

I have a table with multiple columns in that one column have data like text field in that data is either A or B and another column is of link type link is getting fetched by id column, Now I have a situation by comparing the data in column1 if it's 'A' I want to navigate to page 3 and If it's 'B' I want to navigate to page 4 by click of link column. How to achieve this?
It would probably be easier for us if you actually shared table and its contents instead of describing it; moreover, as you wrote it as a single sentence with no punctuation, it is difficult to understand what you want to say.
The way I understood it, table is used as a source for some kind of a report (interactive or classic?). One of its (reports) columns is used as a link to another page. As link depends on column's value, I suggest you use a case expression and compose link to target page.
I don't know how you are creating the link now, but - if you already don't use it - have a look at GET_URL function which does most of the dirty job for you. In its simplest appearance, you'd just
select id,
apex_page_get_url(p_page => case when column1 = 'A' then 1
when column2 = 'B' then 2
end) as link
from ...
You need to create Dynamic action on Button.
Button -> True -> Action := Execute server-side-code
Settings -> language := PLSQL
FOR PLSQL QUERY
3)Items to Submit = P7_NEW,P7_NEW_1
4) Items to Return = P31_URL
This will create URL and Trigger the URL to next page

i've created a interactive report in oracle apex and i want to connect different links to different rows of the same column

this is my oracle apex report page i'm having a problem in. It has a interactive report which has 2 columns but both the rows of the same column refer to the same page in the application or for the matter to same url. i want to give different link to different rows of the same column.
You'll have to create links manually for each row. For example (taken from one of my IRs):
SELECT
'f?p=&APP_ID.:' || case when r.id_obr = 6 then 217
when r.id_obr = 7 then 221
end ||
':&APP_SESSION.::NO::' || case when r.id_obr = 6 then 'P217_ID_OBR6'
when r.id_obr = 7 then 'P221_ID_OBR7'
end ||
':' || r.id_obr67
as link, ...
Created in such a way, it'll take you wherever you want, passing any values you want to any page you want.
We dont know what version of apex you are on, but I will just give you the answer that works for me.
Create the links on each column and then create hidden page items on the page you are linking to, then using the links, have them set a value to those page items based on what was clicked.
Then you can just use those page items in your SQL query on the page you are linking to.
Or you could even use those items to create filters, but those a pain in the ass to set up, so I would suggest adding the items to your query for simplicity.

How to add a link two report in Oracle Apex

I have the following tables (and their structures).
airplane (airplane_id,type,total_seats,start A ,end A,start B,end B,startC,endC)
flight_schedule (flight_id,departure_dt,source,destination,arrival_dt)
pk10 1-12-15 pew kar 2-12-15
flight_seating_detail (flight_id,departure_dt,seat_no,class,fare,status)
I have created a form and reports on these two tables, and I want to add a link to flight_id, when click on that I want to start filling in flight_seating_detail table as (pk10, 1-12-15, 1, 'a', 20000, open) up to limited rows with a change in seat_no.
I have a code for this but how can I use this in apex column link. Please do help me!
are you running apex 5 or 4?
on apex 5, under the report that has been created find the column you wanted to link, there is a link property that lets you set the target page together with what value you want to pass in order for you to fetch the data you wanted to show

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