Link column from an interactive report to insert a row in a tabular form
Hi, I need your help, i'm new on APEX and i really need to make a "link column" from an "interactive report" to insert a row into a "tabular form".
I mean that when you click the "link column" instantly create a new row in the Tabular form with the information of the linked row on the interactive report. Its something like that.
I really appreciate your help.
Ricardo Capuz
Hi Ricardo,
You can use the following code as per your requirement (this is just an example),
(In this case IR report is in Page#1 and Tabular form is in Page#2),
On Page#1, Create a hidden item (i.e 'P1_ID')
IR Report query as like the below,
select empno,
ename,
job,
mgr,
hiredate,
sal,
comm,
deptno,
empno "copy"
from empUse the below JS code in Page HTML Header section,
function f_insert_row(pSub)
$s('P1_ID',pSub);
doSubmit('ADD');
Edit Report Attribute -> copy column -> Under Column Link
Link Text: Select your column name (i.e. #EMPNO#)
Target: URL
URL: javascript:f_insert_row(#EMPNO#);
Then create a process to insert like below,
BEGIN
insert into emp_test (select * from emp where empno=:P1_ID);
END;Process condition as * Request=Expression1* in Expression1 as 'ADD'.
At last, create a branch to Page#2, Check 'include process success message' and with the same condition as * Request=Expression1* in Expression1 as 'ADD'.
Thanks,
Lakshmi
Similar Messages
-
Best way to style a column in an interactive report?
Since I'd rather not do it directly in the SQL used to populate the report, can someone suggest a clean way to style all cells of a given column from an interactive report? Perhaps all cells of interest can be addressed through jquey using the "headers" attribute they share?
Oh, and I'd also like to make the vertical separations between cells aparent if possible....Please try this one:
.apexir_WORKSHEET_DATA TD {border-style:ridge;border-color:#98bf21;
border-width:3px;}For more details please visit:
http://www.w3schools.com/css/css_border.asp
Regards,
Fateh
If you believe that my answer was helpful or correct, then please mark it as helpful or correct.. -
Link column - populating a form from an interactive report?
Hi
I have an interactive report which works great. I have now added a link column which leads to a form in my application,
How can I link the records in the interactive report with the form, so when a user clicks on the link column the form is populated with the details of that record from the interactive report?
Hope this makes senseHi,
The easiest way is to create it using wizard when you create a page:
Create Page -> Form -> Form on a Table with Report
The link will be created automaticaly on the base of the table Primary key or Rowid.
Otherwise: On the created Form there should be a page process called similar "Fetch Row from TABLE" (it is automated row fetch process)
There should be defined the primary key Item.
Now you can fill this item in report link attribute:
Link to Page -> your Form
Set the item Name and Item Value parameters:
FORM_ITEM_PK #REPORT_ITEM_PK#
If the Form is based on another table -> just use
Link to Page -> your Form
Set the item Name and Item Value parameters(here you can populate more fields - but there will be good to use some dynamic action instead):
FORM_ITEM_1 #REPORT_ITEM_1#
FORM_ITEM_2 #REPORT_ITEM_5#
FORM_ITEM_3 #REPORT_ITEM_3#
Regards
J :D
Edited by: jozef_SVK on 16.7.2012 4:22 -
Pass value from previous interactive report to create record form
Hi All,
I am an APEX newbie and have an APEX 3.2.1 application that is still being developed that is working reasonably well. The problem I am having is the following:
I have 3 interactive reports. These are defined on their respective tables, namely, clients, servers, and databases. By clicking on a client name, it shows the servers that are associated with that client. By then clicking on a server, it shows me the databases that are on that specific server. I am able to perform updates, deletes and inserts on all of these.
In order to say create a server, i click on the name of a client and it brings me to the Server Interactive report to see the associated servers. I then click a "Create a Server" link that brings me to the create a server page. The issue i am having is that I would like to have the previous value of the primary key (Client ID) passed from the Server interactive report to the form where i create a new server so that the client ID is already populated in the Create a Server form. Presently, the only way i am able to do this is by defining the client ID column on the Create a server form as a select list and displaying ALL the different clients. By selecting a client name, this list then returns the client id associated with that client name. This is a potential source of confusion for the users and it would be much better if the client ID was already in a text field that is disabled and all they have to do is fill out the other fields of the form.
I would greatly appreciate any help in this matter as I am fighting project deadlines. I have seen other examples that are similar, but i am still experiencing difficulty.
Thanks,
TimHi,
I am still very confused as to how to get this to work.
I cannot have the value passed by clicking the client ID link from the Server Interactive Report in order to populate the Client ID field in the Add Server Form. It MUST be done by clicking an Add Server button that will pass the value as well as take me to the Add Server Form. So far, I have only been able to have the value show up if i click the client ID column on the Interactive report that has a column link defined as follows:
Name VALUE
P9_CLIENTID #CLIENTID#
However, when i do have the value passed this way i receive the following error message which proves that it is not saving the god damn state!
ORA-01400: cannot insert NULL into ("USERS"."NEW_SERVERS"."ClientID")
Error Unable to process row of table NEW_SERVERS.
Even if the value appears in the text field, it isnt really there!
How to make it know the value is there is beyond me.
I dont know what to think of this situation. I have tried all types of settings and I have a feeling it will be 2010 before this is resolved.
It is really frustrating, it has been days i am trying to get this to work...
Thanks,
Tim -
Referencing columns in an interactive report
I need to link an interactive master report in APEX to a interactive detailed report. Both reports have a common column name (PCN). To create a link from the master report to the detailed report, we must specify a "Name" in the column link section for the column in the master report. My question is: how does one reference a column in an interactive report so an entry can be provided in the "Name" box in the column link section?
I developed a solution by creating a text item (P1_PCN) in the detailed report and using P1_PCN as the "Name". I then modified the source for the detailed report to be: select . . . where pcn = :p1_pcn. However, what would we do if the user community wants the functionality to click on a variety of column values in the master report, e.g. filter the detailed report by a value of PCN or STHN or UIC or etc? I rather think this could be done but it would be very cludgy.
ThanksBasically, you are doing it the right way.
If you are sure that there are no overlapping column values, you can modify the query of the detail report to something like
select . . .
where (pcn = :p1_pcn
or sthn = :p1_pcn
or uic = :p1_pcn
) -
Retrieve SQL with filters applied from an Interactive Report
I want to use an Interactive report as interface for providing parameters to a base report query.
I would like to capture the full SQL code from the filtered interactive report and then run the sql to create a collection.
I have found this tread
Re: Using Data from filtered Interactive Report
which says that you can use APEX_APPLICATION_PAGE_IR to access the reports SQL. This holds the information about the interactive report when the user saves it. The sql code from the interactive report (after the user has added filters) is stored in the field sql_query.I can only retrieve the base query and not the filtered version even after saving.
Any ideas how this can be done would be appreciated.
regards
PPOK Darren I think I've got it working. My solution is an adaption that follows the steps of a blog I found here: http://stewstools.wordpress.com/2009/02/19/get-ir-where-clause/
My solution allows you to click on a button and the records that are currently displayed in the IR report are saved to an APEX collection. You can then use the collection to save records to a table or run a report on another page. (I haven't included code for this last step but it's easy to find on the forum)
First a bit of background knowledge. The following APEX views hold all the information on IRs that you access via PLSQL code in the package you need to download. Run an IR report, save a version of the report, then in SQL Workshop have a look at:
select * from APEX_APPLICATION_PAGE_IR
select * from APEX_APPLICATION_PAGE_IR_COND
select * from APEX_APPLICATION_PAGE_IR_COL
select * from APEX_APPLICATION_PAGE_IR_RPT
When you run an IR report it has an internal ID that you can access and also a Base Id for each Saved report that is currently in context.
Here are the steps:
1) Download the following package and install it in the workspace schema
http://www.mediafire.com/?nj118x9vmc9
click on the link "click here to download"
2)In the HTML header Attribute of the page where your IR runs, put the following Javascript:
<!--===================================================================-->
<!--FUNCTION TO RETRIEVE IR REPORTS SQL WITH WHERE CLAUSE
<!--===================================================================-->
<script language="JavaScript" type="text/javascript">
function SaveAndRunReport() {
document.location='f?p=&APP_ID.:3:&SESSION.:CONSTRUCT_IR_QUERY:NO::'+
'P3_BASE_REPORT_ID:'+$v('apexir_REPORT_ID');
</script>
<!--===================================================================-->
Notes: You will need to obviously change the URL above to reflect your Page No. (3) and the name of a HIDDEN Item (P3_BASE_REPORT_ID) that you will populate with the base ID of the report.
Setting :P3_BASE_REPORT_ID to +$v('apexir_REPORT_ID') is an internal thing and works out of the box. It returns the Id of the Base report.
3) Create a button called SELECT_SPECIMENS (in region position - top of region) in the IR region that will initiate the execution of the IR background SQL to create a collection with the current selected records.
TARGET= URL
URL Target = javascript:SaveAndRunReport();
You might also want to create a condition that only shows the button when there are records selected
CONDITION TYPE=Exists(SQL returns at least one row)
EXPRESSION 1 - put the SQL of the IR report here.
4)Create a branch back to the same page (3) and with the REQUEST attribute set to the value in the Javascript URL above e.g. CONSTRUCT_IR_QUERY. Create a condition on the branch that uses this branch WHEN BUTTON PRESSED= SELECT_SPECIMENS
5) Create an AFTER HEADER PROCESS with the following code:
declare
v_base_query clob;
v_where clob;
v_query clob;
v_base_where varchar2(12):=' where 1=1 '; -- incase there is no where clause in the base query
begin
if apex_collection.collection_exists('IR_COLLECTION') THEN
htmldb_collection.delete_collection( p_collection_name => 'IR_COLLECTION');
end if;
--GET THE BASE QUERY OF THE IR REPORT
select sql_query
into v_base_query
from APEX_APPLICATION_PAGE_IR
where application_id=:APP_ID
and page_id=:APP_PAGE_ID; -- you can only have one IR report per page
--UNCOMMENT TO VIEW THE PARAMETERS TO THE PACKAGED FUNCTION
--raise_application_error(-20001, :APP_ID||'-'||:APP_PAGE_ID||'-'||:SESSION||'-'||:P3_BASE_REPORT_ID);
--GET THE SQL FILTER CODE
select apex_ir_query.ir_query_where(:APP_ID,:APP_PAGE_ID,:SESSION,:P3_BASE_REPORT_ID)
into v_where
from dual;
--CHECK TO SEE THAT THERE IS A "WHERE" CLAUSE IN THE BASE QUERY
if instr(upper(v_base_query),'WHERE ') > 0 then
v_query:=v_base_query||' '||v_where;
else
v_query:=v_base_query||' '||v_base_where||' '||v_where;
end if;
--UNCOMMENT TO SEE THE FULL QUERY SYNTAX
--raise_application_error(-20001,v_query);
--CREATE COLLECTION FROM IR RECORDS
apex_collection.create_collection_from_query(P_collection_name=>'IR_COLLECTION',p_query=>v_query);
exception
when others then
raise_application_error(-20001, 'Interactive report not found. Contact Administrator. Could not create collection of records.');
end;
remember to update P3_BASE_REPORT_ID above to your HIDDEN ITEM name.
Set the following attributes for the process above
CONDITIONAL PROCESSING
CONDITION TYPE = Request=Expression 1
EXPRESSION 1 --> CONSTRUCT_IR_QUERY (Note: this was set on the branch in step 4 above)
6) Run the IR report, click on the "SELECT SPECIMENS" button then click on the Session link on the Developer's Toolbar and select VIEW COLLECTIONS from the popup list then click GO. You should now see the IR records.
By the way I've been testing in IE not Firefox.
...and that's it!
enjoy
Paul P -
Problem adding column in an interactive report
Hi all
I am dealing with many interactive projects in my application. Sometimes I have to add a column to the interactive report. When I do so, the column doesn't appear in the interactive report...On the page I have to click on "Actions" then go to "Selected columns" and then display it ! the problem is when I logout and login again
the column desappear again and I have to do samething again and again...Is there a way to set it appear by defaul always ???
THank youMoun wrote:
I am dealing with many interactive projects in my application. Sometimes I have to add a column to the interactive report. When I do so, the column doesn't appear in the interactive report...On the page I have to click on "Actions" then go to "Selected columns" and then display it ! the problem is when I logout and login again
the column desappear again and I have to do samething again and again...Is there a way to set it appear by defaul always ???After adding new columns to an existing IR, you need to select them for display as a developer, and save the new report as the Primary Default. -
Custom Column freezing in interactive reports
Hi,
Can anyone help me regarding column freezing in interactive reports?
I want to keep few of the column of my IR fixed that is not scrollable(horizontally),selection of column to be freezed should also be there.
Along with it i also want a horizontall scrollbar to appear for scrolling the report.
Thanks,Hi Vish,
I was informed by SAP few months back that Interactive Reports can not be enhanced with custom fields. I don't see any documentation regarding this.
You may want to check with SAP also.
Regards,
Paparao Undavali -
Problem with column groups on Interactive Report
Hi
I am hoping that someone can help with this problem.
I am attempting to control both the grouping and ordering within each group of fields in the single row view of an interactive report. Creating column groups appears to be OK at first (sequence, name and description) but if I then attempt to edit the group, the sequence box appears to be empty even though it was filled with a unique number at the time of creating the group.
In addition, any changes to the order of the fields within the group made using the shuttle box at the bottom of the screen don't seem to be saved even to the Apply Changes button is pressed.
Anybody know what is happening here and can anyone suggest how to control both the order of the groups and ordering within each group?
Thanks in anticipation
MartinMoun wrote:
I am dealing with many interactive projects in my application. Sometimes I have to add a column to the interactive report. When I do so, the column doesn't appear in the interactive report...On the page I have to click on "Actions" then go to "Selected columns" and then display it ! the problem is when I logout and login again
the column desappear again and I have to do samething again and again...Is there a way to set it appear by defaul always ???After adding new columns to an existing IR, you need to select them for display as a developer, and save the new report as the Primary Default. -
Colour code a column in an interactive report
Hi
Could anybody tell me how to colour code a column in an interactive report please.
I am using apex version 3.1.
Thanks in advanceWhen your IR is displayed, go to the Actions Menu, choose "Highlight" and enter the condition when which row or field should be highlighted.
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at -
Concatenate columns from two different reports
In OBIEE 11g report, I am looking for a method to concatenate columns from two different reports.
My requirement is, if I show 'Units Produced' for customer A, I need to show another column 'Units Produced' for a related customer B.
Every customer has one related customer.
So my report shows all the data for customer A, but I need to add one column which is for custome B , so I am looking a way to concatenate columns or if some other way this can be doneCustomer A is dimension table. You mapped to fact to get Customer A details.
Now you want for Customer B. Now create one more alias table for Customer and name it as customer B and join with Fact on Customer B keys and use it.
Each customer has related customer.
2 dimension tables one for customer and other for related customer. -
How to wrap a Column (Increase/Decrease column width) in Interactive Report
Hi,
I have a Interactive Report and I want to wrap the column values.
Also want to increase/decrease width of the columns..
I have 2 columns say.. Description and List
List - aaaaaaa, bbbbbbb, hhhhhhh, nnnnnnn, 222222, 55555555, 77777777, ..... // list of values are seperated by ,
// 1. want to wrap the values ..I mean to decrease the width
Descriptiopn - sdgssdjkllkkkkkkkk // -- here I want to increase the width of column
dgdggdfgdfgdgg
dfgdfgdfdfggfdg
dgdgdgdgdgdf2ndly for the List Column, can I put the sepearte values in each Line (values are seperated by , here) - ROW will only one.
For each ROW, I want to display List column as shown below.
List - aaaaaaa
bbbbbbb
hhhhhhh
nnnnnnn
222222
IS this possible in Interactive Report??
Thanks,
Deepak
Edited by: Deepak_J on Feb 23, 2010 4:14 PMActually, I want to increase/decrease the column width in Interactive Report.
As shown the in the example of Description field...it's coming in 4-5 lines.
I want to increase the width of Description column..so that it should come only in 2 lines..
thanks,
deepak
Edited by: Deepak_J on Feb 23, 2010 4:32 PM -
How to increase the column size of interactive report
Hi , I am using apex 4.2 and theme 25 ..
i did not find any option to increase the column size of interactive report. where as in classic report i can do so ,,
Please guide me to achieve that.
Thank You,
Nihar NarlaNihar Narla wrote:
Hi , I am using apex 4.2 and theme 25 ..
i did not find any option to increase the column size of interactive report. where as in classic report i can do soThis can be done using CSS. Create a rule like this in the page Inline CSS property:
.apexir_WORKSHEET_DATA td[headers="COLUMN_ALIAS"] {
width: 10em;
}where COLUMN_ALIAS is the alias of the column in the report query and the width measure is whatever you require. -
Creating Dynamic Column Headings in Interactive Reports
Hi,
any ideas how I can alter the name of a column in an interactive report.?
I have columns whose usage is defined by the end user and consequently want to have their own meaningful column header displayed whenever this column is referenced.
I can get column headers to change in standard reports by using PL/Sql to return the column headers. In Forms, I use shortcuts (these don't seem to work for reports, I wish they did) but I'm at a loss on how to achieve this with IR's.
Thanks
MikeI wrote a script(application process) that updated the table that holds column name. I changed the display name, not the column name. I cant remember the actual table, but i found it by looking at the code that create the "APEX Application Page Ir Col" View.
I dont know if this is best practice, but it works for me.
Edited by: Adrian3000 on Dec 26, 2008 9:38 AM -
Interactive report's data not displaying on the edit form.
I have an interactive report that contains 3 rows. When I click on the edit button next to one of these rows, the edit form displays the data from that row.
But when I click the edit buttons next to the other 2 report rows, I get an error message that states: "ORA-01403: no data found. Error Unable to fetch row."
I do not see why this is happening. The PK of the table involved is "Request Date", so the report's "Link Column" region sends the value "Request Date" to the item P54_Request_Date in the form page.
Any idea why this would work correctly for one of the report rows but not for the other 2?
Clearly, each of the report rows must have a value for the PK, so why would the form not be able to find the same row that the report displays? Is it a problem with the form's "Fetch Row from" process?
Thanks.Hello:
Your problems are primarily related to in your choice of a 'Date' type as the PK for your table. The Automated Row Fetch (ARF) process uses a SQL statement similar to the one below to retrieve a record from a table select c1, c2, c3 ... from tab where PK_col = :page_item_containing_PK_value . This would work find if the the 'page_item_containing_PK_value' were of the DATE data type. However, all APEX binds are done using varchar2. This means that the 'page_containging_PK_value' needs to have the char representation of the date that matches the default date setting on your database. So the page-item needs to be something like 'DD-MON-YYYY HH24:MI'. In your case the PK item is probably being set to 'DD-MON-YYYY' and therefore the fetch fails.
Now, for the 'issue with the :' in the character representation of the date.The link on the report page uses the standard APEX URL syntax to construct the link
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
As you can see, the ':' acts as the separator that delineates the components that make up the APEX URL. So, having a ':' in the 'itemValues' component will make the APEX engine treat whatever follows the ':' in the value passed as a delimiter as opposed to being part of the value being passed.
Varad
Maybe you are looking for
-
App Updates with 1st gen iPod Touch running v2.1 OS
Hello all, I got notification from the app store that I have a couple of updates and when I went to install the updates, it said that they are all ready installed and wouldn't give me the option to install. I have rebooted my 'Pod but that didn't hel
-
When I copy an image from the web and paste it in AI the URL is inserted and not the image. How do I change that?
-
Update item characteristic values using BAPI_SALESORDER_CHANGE
Hi Experts, Could anyone give me sample code on how to update the characteristic values of a sales order item? Points will be awarded... Thanks! Regards, LM
-
Getting photo from mobile me gallery to contact
can anyone tell me how to get a photo from the mobile me gallery onto a contact in the address book.?
-
Update quantity in sales order by 'BAPI_SALESORDER_CHANGE'
I am trying to use the 'BAPI_SALESORDER_CHANGE' to change a sales order. I have to add a line item for empties in the sales order. the line gets sucessfully added but the quantity is not gettign updated. I have tried all the fields of table ITEM_IN (