How to add a link two report in Oracle Apex - oracle

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

Related

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.

Question on changing the APEX data load wizard to give default target columns

Within the data load wizard that comes with APEX 18.1, after you choose your csv file to be uploaded you are offered a "TARGET COLUMN" drop down LOV which defaults to "DO NOT LOAD". It is possible to tell APEX which values you want in this LOV. I have done this.
My issue is, that this is quite laborious. Your users will not necessarily know which value you want them to pick from the LOV to map the related column when they are using a csv file with no header. As they are going to be doing.
Does anyone know how to change the "DO NOT LOAD" value in the LOV to another value? If I could get it to default to a column of my choosing, this would be great. Alternatively, there's a "SOURCE COLUMN" field in the wizard.
Getting the "SOURCE COLUMN" field to denote which column I wish users to map to the LOV value would be something also. Has anyone faced this before? Does anyone know if it is possible to do what I am suggesting as a work around? Thanks for looking and for your thoughts.
APEX does the column mapping automatically by checking the name of the column in the csv(the first row is names usually).
So if the names of the columns match in the table and the csv, it will connect them by itself. What you can also do is set column aliases.
If you want to edit the existing data load, you can go to Shared Components- Data Load definitions and pick the one you are using in there.
Then you can set column aliases there. But afaik you can only do one alias per column there.

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

Birt Designer - Add Tables programmatically

i'm using Eclipse Birt Designer v4.4.1,
What i would like to do in the report that i'm designing is to add programmatically tables (the same table structure) in my report based on a value that i get from a database query.
Example :
if (queryValue = 1) ==> Add one table
if (queryValue = 5) ==> Add 5 tables
etc ...
Obviously i should add a loop that creates the tables.
Is there a way to do this in Birt Report Designer ?
Thanks.
the easiest way to do this, is to create 2 datasets in the report, the first generate the number of tables and binded to a table element, and the second generate the rows for each table and binded to a table element that is added inside the first table element in the report, and then using the visibility property, we could hide the irrelevant rows.

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.

Resources