How to pass parameter from form to report [message #495905] |
Wed, 23 February 2011 04:06 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/fde55cc4446a83fd55ef9e829519dfda?s=64&d=mm&r=g) |
zahidbutt
Messages: 13 Registered: January 2011 Location: Lahore
|
Junior Member |
|
|
Hello Dears,
I have created a simple form & report based on 2 tables Cust & cntry.
I just want to display all customers of region selected in the criteria form. I am uploading the files.
Other than selection criteria report is fine.
Thanks
|
|
|
|
|
How to pass parameter from form to report [message #496033 is a reply to message #495905] |
Wed, 23 February 2011 22:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/fde55cc4446a83fd55ef9e829519dfda?s=64&d=mm&r=g) |
zahidbutt
Messages: 13 Registered: January 2011 Location: Lahore
|
Junior Member |
|
|
Dear Experts,
I have developed a simple form to view reports for customers related to specific region, selected in form.
I do not know how to pass parameter to report & what changes are to be done in query on report side.
Following is code on form's push button.(when_button_pressed)
*********
DECLARE
pl_id ParamList;
BEGIN
pl_id := Get_Parameter_List('tmpdata');
RUN_PRODUCT(REPORTS,'d:\test reports\custrep2', SYNCHRONOUS, RUNTIME,FILESYSTEM,pl_id, NULL);
END;
**********
Here is the query on report side.
********
select all cust.cust_id,cust.cstnam,cust.cntry_id,cntry.cntry_nam,
cntry.region from cust,cntry
where cust.cntry_id=cntry.cntry_id
********
Please let me know how to do this.
Thanks
|
|
|
Re: How to pass parameter from form to report [message #496047 is a reply to message #496033] |
Thu, 24 February 2011 01:02 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
There's a form. You perform a query, and several records are displayed in a block. Now you want to display the same records in a report.
If that's so, I'd try with GET_BLOCK_PROPERTY built-in, its LAST_QUERY property. It makes it possible to transfer the whole WHERE clause to report.
I did it through global variables; note that they can contain up to 255 characters, so - if you expect your WHERE clause to be longer than that, you might need to create two (or more) global variables. In report, you'd concatenate them.
The most appropriate way is to use WHERE clause as a lexical parameter.
[Updated on: Thu, 24 February 2011 01:06] Report message to a moderator
|
|
|