Step 1:
As an example, in the first step, I manually generated the button Bulk Print in the block to build a button with any name in my instance, I built a button named Bulk Print.Step 2:
Step 3:
When the WHEN-BUTTON-PRESSED trigger is triggered.
Copy and paste the code that I have provided below.
declare
pl_id ParamList;
vr_filename varchar2(500);
cursor c1 is
select e.empno , e.ename , e.job , e.mgr , e.hiredate , e.sal , e.comm , e.deptno from emp e;
BEGIN
FOR REC IN c1 LOOP
pl_id
:= Get_Parameter_List('tmpdata');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
pl_id := Create_Parameter_List('tmpdata');
Add_Parameter(pl_id,'P_EMPNO',
TEXT_PARAMETER, rec.empno);
Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER,'FILE');
Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER,'PDF');
vr_filename
:= 'E:\Bulk_PDF\'||rec.empno||' '||rec.ename||'.PDF';
Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER,vr_filename);
Add_Parameter(pl_id, 'PARAMFORM',
TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, 'E:\number into
Words.RDF', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
END LOOP;
END;
Step 4:
Now run the form with the help of Ctrl + R or go to the object
navigator and press the and press this button to run the form.
Output:
I hope it's helpful for you. If you have any queries, don't hesitate to contact me.
0 comments:
Post a Comment
If you have any doubts, please let me know. I will help you.