passing parameters from form to report in D2k 6i [message #305273] |
Mon, 10 March 2008 05:13 |
hushab2001
Messages: 9 Registered: February 2008
|
Junior Member |
|
|
hi there,
i want to pass a phone no.(value entered in text box) from a form to a report as a parameter value to generate final report based on the value passed from the form.how do i do that?
also i want to suppress the display of the parameter form in reports runtime.
please help...
urgent...
|
|
|
|
Re: passing parameters from form to report in D2k 6i [message #305479 is a reply to message #305273] |
Mon, 10 March 2008 23:54 |
irfan.ocp
Messages: 29 Registered: February 2008 Location: Karachi, Pakistan
|
Junior Member |
|
|
Dear Hushub.
You can try this. I always use this code for passing the parameter to run report by RUN_PRODUCT Procedure.
Kindly read the Script Code:-
--- Built-in: RUN_PRODUCT ---
PROCEDURE Run_RDF_Report IS
plid ParamList;
BEGIN
plid := Get_Parameter_List('tmpdata');
IF NOT Id_Null(plid) THEN
Destroy_Parameter_List( plid );
END IF;
plid := Create_Parameter_List('tmpdata');
Add_Parameter(plid,'phonechk',DATA_PARAMETER,:txt_phoneNo);
Add_Parameter(plid, 'PARAMFORM', TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, [report_name], SYNCHRONOUS, RUNTIME,
FILESYSTEM, plid, NULL);
END;
Best Regards,
Muhammad Irfan Bakali
|
|
|
Re: passing parameters from form to report in D2k 6i [message #305482 is a reply to message #305479] |
Tue, 11 March 2008 00:02 |
hushab2001
Messages: 9 Registered: February 2008
|
Junior Member |
|
|
thank you very much irfan for your help. also i wanted to know that will this work even if i write a query with bind variables in the report builder's query builder?
whenever i write a query in report its creates the parameter automatically.will this paramater accept the values from the form as per the code u have sent me?
thanking u.
|
|
|
Re: passing parameters from form to report in D2k 6i [message #305500 is a reply to message #305273] |
Tue, 11 March 2008 01:36 |
irfan.ocp
Messages: 29 Registered: February 2008 Location: Karachi, Pakistan
|
Junior Member |
|
|
Dear Hushub
Yeah you can pass a query parameter but firstly you have to create a report from this parameters.
Mostly the people send Lexical / Where Clause Conditions.
and there is no diff on sending the query parameter just you have to give the Q1 or Query Parameter Name and pass the query
Example:-
PROCEDURE Run_RDF_Report_QRY IS
plid ParamList;
query_attach varchar2(500);
BEGIN
query_attach := 'SELECT EMPNO, ENAME FROM EMP WHERE DEPTNO = '||:DEPTNO||';
plid := Get_Parameter_List('tmpdata');
IF NOT Id_Null(plid) THEN
Destroy_Parameter_List( plid );
END IF;
plid := Create_Parameter_List('tmpdata');
Add_Parameter(plid,'Q1',DATA_PARAMETER,QUERY_ATTACH);
Add_Parameter(plid, 'PARAMFORM', TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, [report_name], SYNCHRONOUS, RUNTIME,
FILESYSTEM, plid, NULL);
END;
Pls Note: this script is not tested because my developer is not working. but the logic will use same as code
Have a nice day
Best Regards,
Muhammad Irfan Bakali.
|
|
|
|