Very Urgent(Passing Parameters) [message #308318] |
Mon, 24 March 2008 01:02  |
oralce
Messages: 1 Registered: March 2008 Location: India
|
Junior Member |
|
|
Hi Gurus,
I have a problem in importing data in excel. I am getting data of my report from when-button-press trigger.But I am facing problem in filtering data (problem in passing parameters).
For below code i am getting data but without parameters.
declare
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
args ole2.list_type;
rowcount integer;
v_cust_code om_customer.cust_code%type;
cursor c1(v_cust_code om_customer.cust_code%type) is SELECT CUST_CODE A,CUST_NAME B FROM OM_CUSTOMER
order by CUST_CODE;
begin
application := ole2.create_obj('Excel.Application');
ole2.set_property(application,'Visible','True');
workbooks := ole2.get_obj_property
(application,'Workbooks');
workbook := ole2.invoke_obj(workbooks,'Add');
worksheets := ole2.get_obj_property
(workbook,'Worksheets');
worksheet := ole2.invoke_obj(worksheets,'Add');
rowcount := 0;
for rec1 in c1(v_cust_code) loop
rowcount := rowcount + 1;
args := ole2.create_arglist;
ole2.add_arg(args,rowcount);
ole2.add_arg(args,1);
cell := ole2.get_obj_property(worksheet,'Cells',args);
ole2.destroy_arglist(args);
ole2.set_property(cell,'Value',rec1.A);
ole2.release_obj(cell);
args := ole2.create_arglist;
ole2.add_arg(args,rowcount);
ole2.add_arg(args,2);
cell := ole2.get_obj_property(worksheet,'Cells',args);
ole2.destroy_arglist(args);
ole2.set_property(cell,'Value',rec1.B);
ole2.release_obj(cell);
end loop;
ole2.release_obj(worksheet);
ole2.release_obj(worksheets);
ole2.release_obj(workbook);
ole2.release_obj(workbooks);
ole2.release_obj(application);
end;
v_cust_code is not working in the above query.
I want to fliter data using DATE and with many things.Please help me in this.
Waiting for your earliest reply.
Thanks,
Rupesh.V.
|
|
|
|