problem for export to excel functionality-unable to compile the form [message #409601] |
Tue, 23 June 2009 04:49 |
saileshbandaru
Messages: 1 Registered: June 2009
|
Junior Member |
|
|
Hi David,
While trying to compile the code which is associated with d2kwutil package I am unable to compile the code written in WHEN BUTTON PRESSED trigger.
error showing is
Client_OLE2.Obj_Type is not declared.
Please help me regarding this.
I have attached the d2kwutil.pll version6.0 and even then it is not working.
The total code is given below:
DECLARE
application Client_OLE2.Obj_Type;
workbooks Client_OLE2.Obj_Type;
workbook Client_OLE2.Obj_Type;
worksheets Client_OLE2.Obj_Type;
worksheet Client_OLE2.Obj_Type;
args Client_OLE2.List_Type;
cell client_ole2.Obj_Type;
j INTEGER;
k INTEGER;
BEGIN
application := Client_OLE2.create_obj('Excel.Application');
workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
workbook := Client_OLE2.Invoke_Obj(workbooks, 'Add');
worksheets := Client_OLE2.Get_Obj_Property(workbook, 'Worksheets');
worksheet := Client_OLE2.Invoke_Obj(worksheets, 'Add');
go_block('BLK_ICDS_FRS_ETRACK');
first_record;
j:=1;
k:=1;
while :system.last_record = 'FALSE'
loop
for k in 1..5 /* DEPT has 3 columns */
loop
If not name_in(:system.cursor_item) is NULL Then
args:=Client_OLE2.create_arglist;
Client_OLE2.add_arg(args, j);
Client_OLE2.add_arg(args, k);
cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
Client_OLE2.destroy_arglist(args);
Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
Client_OLE2.release_obj(cell);
End If;
next_item;
end loop;
j:=j+1;
next_record;
end loop;
/* For the last record */
for k in 1..5
loop
If not name_in(:system.cursor_item) is NULL Then
args:=Client_OLE2.create_arglist;
Client_OLE2.add_arg(args, j);
Client_OLE2.add_arg(args, k);
cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
Client_OLE2.destroy_arglist(args);
Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
Client_OLE2.release_obj(cell);
End If;
next_item;
end loop;
Client_OLE2.Release_Obj(worksheet);
Client_OLE2.Release_Obj(worksheets);
/* Save the Excel file created */
args := Client_OLE2.Create_Arglist;
Client_OLE2.Add_Arg(args,'d:\test.xls');
Client_OLE2.Invoke(workbook, 'SaveAs', args);
Client_OLE2.Destroy_Arglist(args);
/* release workbook */
Client_OLE2.Release_Obj(workbook);
Client_OLE2.Release_Obj(workbooks);
/* Release application */
Client_OLE2.Invoke(application, 'Quit');
Client_OLE2.Release_Obj(application);
END;
|
|
|
|
|