Home » Developer & Programmer » Reports & Discoverer » passing parameters from form to report in D2k 6i (windows XP,d2k 6i,oracle 9i)
passing parameters from form to report in D2k 6i [message #305273] Mon, 10 March 2008 05:13 Go to next message
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 #305278 is a reply to message #305273] Mon, 10 March 2008 05:22 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Using

create_parameter_list
add_parameter_list
run_product

built ins

Thanks
Mano
Re: passing parameters from form to report in D2k 6i [message #305479 is a reply to message #305273] Mon, 10 March 2008 23:54 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Wink

Have a nice day

Best Regards,
Muhammad Irfan Bakali.
Re: passing parameters from form to report in D2k 6i [message #321388 is a reply to message #305273] Tue, 20 May 2008 02:37 Go to previous message
eoracle
Messages: 4
Registered: April 2008
Location: pune
Junior Member
does it skip the parameter form ,i have tried but parameter form opens please tell me the solution
please reply
Previous Topic: Bad output orientation
Next Topic: Error while running Report Builder
Goto Forum:
  


Current Time: Fri Jun 28 22:05:49 CDT 2024