how to print selected person only from form builder(runtime)? [message #86339] |
Wed, 22 September 2004 18:41 |
eboy
Messages: 17 Registered: August 2004
|
Junior Member |
|
|
hai,
i got 2 tables call LOGIN and ATTENDANCE
in order to view the information or details of employee, the user must insert ICNO on the LOGIN FORM after that it will display the details of Selected person on ATTENDANCE FORM. my question is
can anyone solve my problem on printing the report from the form builder on runtime.
on this ATTENDANCE FORM i got push button(print)
on push button
BEGIN
-- To maximize the window
add_Parameter('default','DESTYPE',TEXT_PARAMETER,'Printer');
-- Run the report synchronously, passing the parameter list
run_product(REPORTS,'C:dhalantest.rep',synchronous,runtime,filesystem,'default',null);
END;
my problem is when i press the print button, it does not print the selected person which has been displayed on ATTENDANCE FORM. in my case it will print all the employee. for example i got 20 records and it will print all, so how to print the displayed/selected record on only.
so any idea to overcome my problem and modified my coding
thanks for helping me
regards
eboy
|
|
|
Re: how to print selected person only from form builder(runtime)? [message #86346 is a reply to message #86339] |
Thu, 23 September 2004 01:25 |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
Eboy first of all change your report's query to accept a new uer defined parameter say P_EMPNO which will receive emno from your Form.
Modify reports' squery as follows:
Select * from emp
where empno = nvl(:P_EMPNO,empno);
No modify the code of your Print button as follows:
Declare
L_Rp_nm Paramlist; /* Parameter list id */
L_qr Varchar2(10):='QS';/* Parameter list name */
Begin
L_Rp_nm := Get_Parameter_List(L_Qr);
If not id_null(L_Rp_Nm) Then
Destroy_parameter_list(L_Rp_Nm);
End if;
L_Rp_nm := Create_Parameter_List(L_Qr);
Add_parameter(L_Rp_Nm,'P_EMPNO', Text_Parameter,:BLOCK.EMPNO);
Add_parameter(L_Rp_Nm, 'Destype', Text_Parameter, 'Printer');
Run_Product(REPORTS,'C:dhalantest.rep', Synchronous, Runtime, Filesystem, L_Rp_Nm, NULL);
Destroy_Parameter_List(L_Rp_Nm);
End;
HTH
Regards
Himanshu
|
|
|
|