Just got started on APEX 5 and can't seem to figure out how to make cells in an Interactive Report clickable. What I'm trying to achieve is something like this:
Let's say I have a report on Page 1:
I want to be able to click on any cell in Column 2 and 3, and it should open a new page and show a list of items that made up that number, something like this:
I understand how dynamic actions work and how I can pass values but I just can't figure out how I can hyperlink or make the cells clickable, to set up any dynamic actions.
You can make the Column Type a Link and under Link Attributes, define the target page and set the items or filter report accordingly. You can have the Link Text as #COLUMN_NAME#.
I think you will find this post useful
http://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html
but most of the time you should start with a very declarative looking link builder, once you change the column Type to "Link"
Related
I need help creating a link in Oracle APEX.
I have two Interactive Report pages created in Oracle APEX.
The first page is an Interactive Report for a list of cats. When clicking on that link, filter the second page's Interactive Report by the "fur color" column. Furthermore, I want to always be "white" in addition to the color of the selected row.
I try 2 types of methods to create a link in Link Builder.
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR. and more one line Value = White
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR.,White
But they did not work.
How should I do it? Does anyone help me?
Thank you for watching this question!
Link Builder should contain only
Name: IR_FUR_COLOR, Value: &P18_FUR_COLOR
Modify the second Interactive Report's query so that its where clause looks like this:
where fur_color in ('white', :IR_FUR_COLOR)
which means that it'll always filter white color, along with any color you pass from the previous page.
There are variations to that approach; for example, you could create another (hidden) item on the 2nd page and pass white to it and then
where fur_color in (:HIDDEN_FUR_COLOR, :IR_FUR_COLOR)
Currently using APEX 5.1.4
My goal is to have the user press a button, which triggers a new row to be added to the bottom of the IG. This row would also need to have some default values pre-populated, such as the sequence column I have functioning as a primary key.
Doesn't matter how exactly, but I was considering doing it with Javascript. However, none of the methods I have found online, regarding adding a row with Javascript, work.
Also, I have the header bar of the IG removed, so finding the native Add Row Button probably is not an option.
--EDIT--
I found some Javascript that successfully allows me to add a row, however, it adds the row directly underneath the currently selected row. I do not see any methods to automatically select the last row of the IG, and it still doesn't solve that the row needs to have some dynamic values upon instantiation.
Here is the javascript:
This shows all of the available functions that can be invoked ( with .invoke() ):
apex.region("id-region-emp").widget().interactiveGrid("getActions").list()
These following lines both instantiate a new empty row on the IG:
("row-add-row" adds to top of IG, "insert-record" adds underneath currently selected row.)
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("row-add-row")
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("insert-record")
Better to use below code:
apex.region("detaildataset").widget().interactiveGrid("getActions").invoke("selection-add-row");
Before applying this code make interactiveGrid editable by clicking on attributes and also apply primary key on one column and then apply this code in Execute javascript code:
apex
.region("detaildataset")
.widget()
.interactiveGrid("getActions")
.invoke("selection-add-row");
I have several tabs. There is a date picker on each tab. I need that date to be the same on all tabs no matter what. So, if the user changes the date on Tab 1, then goes to tab 2, the date on tab 2 will have changed also. I have never created an application level item before and I thought that might be the most efficient way to accomplish what I need (by setting that item's value to the date the user selected). My problem is that I don't know how to set the value of the application item and also how to retrieve that value on another tab.
You didn't describe what exactly you're trying to do, but - if each tab represents its own table, why do you keep the same date value in all of them? Doesn't look like a normalized data model. Consider using a single date column (in one - master - table) and use (i.e. reference) it in others (i.e. details).
As of your question: How about creating a global page (i.e. page 0) and having a date picker item on it? You can display it on any other page you want. For example, if you set its value while on tab 1 and then move on to tab 3, you can again modify that value which will be visible on all other pages. Basically, you'd maintain just one item instead of as many as number of tabs involved. (BTW, doesn't that remind you of what I described in the first paragraph?).
Alternatively, create a date picker item on tab 1 page; on all other pages, create a "lookup" (display) item which would simply display what's been selected on tab 1. That's easy to do, just make its source to be an "Item", such as P1_DATE_ITEM.
In Shared Components > Application Items create new Item called G_DATE.
Then for every datepicker add Dynamic Action on Event Change.
In True action Set Value select Type PL/SQL Expression with code
:G_DATE := :P1_DATEPICKER1;
and Items to Submit :P1_DATEPICKER1
Next in every datepicker Source set Type PL/SQL Expression with code
:G_DATE
used Always (...)
Regards
I have created an interactive report in apex5.0 with below select:
SELECT article_code,article_desc,order_date, order_status
FROM table_order
WHERE status in ('SHIP','DELIVER','CANCEL');
I want for each row record to have a button that when click it calls another page.
How to do that??
There are a couple options.
Edit the column and change the type of the column to Link.
Create an html link with an href to the page you want. Choose type display, then turn of escaping special characters in the column properties.
Calling another page is declarative, out of the box behaviour, and you'll find such examples in the documentation.
Declarative
http://docs.oracle.com/database/apex-5.1/HTMDB/editing-interactive-reports-page-designer.htm#GUID-B30458D6-9678-40D4-A477-28EE466ED50A
As link column
http://docs.oracle.com/database/apex-5.1/HTMDB/editing-interactive-reports-in-component-view.htm#GUID-48AF053F-0E34-40FA-94FE-19C0400AD499
Manual
http://docs.oracle.com/database/apex-5.1/HTMDB/understanding-url-syntax.htm#HTMDB03019
Using dynamic action http://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html
I am trying to link a column from an Interactive Report to another Interactive Report in Apex 5. I want to set the filter in the later one with a value from the first one. I used a column of type Link then clicked on Target button to set the page number like this:
It doesn't work. I read there are other ways, I could use an URL link and build the URL to pass the parameters using a package but if I used this, how can I bind it to the link?
Normally you'll need to specify the operator to be used in the link - documentation:
Developing Reports > Editing Interactive Reports in Page Designer > Linking to Interactive Reports
Snippet concerning setting up a link:
To create a filter, use the following itemNames and itemValues syntax:
IR[region static ID]<operator>_<target column alias>
Consider the following example:
IR[EMP]C_ENAME:KING
Meaning that if you want to place a filter on your report where the column REQUEST_ID matches a given value, you'd need the equals operator syntax:
IREQ_REQUESTID:#REQUEST_ID#
However, using
IR_REQUESTID:#REQUEST_ID#
should also work, as the EQ operator is the default operator.
Also consider other issues: do you have more than one IR on the page? You'll need to reference the correct one. Is your generated link correct? Inspect it!
I found what was causing the filter not to work. I was trying to filter a column of type "link". It doesn't work when it's a "link", but it does when it's "plain text". So now you know. Here's how it's looking...
For me it works like this:
I created an Item (display only)(source type: null) on the second page with the second IR.
In the first IR in the Column Attributes set a Link Text and the Target and Page number (like you did already). In the Name part put your Item that you just created and for the Value put the column name in which are the values for your filter (like #Request_ID'#).
Then again on the second page with the second IR you will put something like this in the Region Source:
select REQUEST_ID,
REQUEST_NUMBER,
NAME,
FIRST_NAME,
COMPANY,
COUNTRY,
TYPE,
RQ_IS_ARCHIVE,
RQ_ID_TO
from REQUEST
where REQUEST_ID = :P20_REQUEST_ID
The :P20_REQUEST_ID is the Item that you created on that second page.
You passed the value from the Request_ID column from the first page in to the Item on the second page, there you used it then as a condition.
Hope this helps you...