Home » Developer & Programmer » Forms » How to pass parameter from form to report (oracle 8 i,forms 6i, windows xp)
How to pass parameter from form to report [message #495905] Wed, 23 February 2011 04:06 Go to next message
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 #495918 is a reply to message #495905] Wed, 23 February 2011 04:42 Go to previous messageGo to next message
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.

Following is the code on when_button_pressed of push button.

*****************
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;
*****************


Thanks
Re: How to pass parameter from form to report [message #495994 is a reply to message #495918] Wed, 23 February 2011 11:22 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Read the form builder help topic: Creating a Parameter List
It'll tell you everything you need with examples.

Next time you attach a form here, use the fmb, there's nothing we can do with an fmx.
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 messageGo to next message
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
Littlefoot
Messages: 21818
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

Previous Topic: Opening a word document
Next Topic: frm-40039 - Not repeated post.
Goto Forum:
  


Current Time: Tue Sep 17 16:28:29 CDT 2024