Home » Developer & Programmer » Forms » problem for export to excel functionality-unable to compile the form (D2K 10g, Windows XP)
icon1.gif  problem for export to excel functionality-unable to compile the form [message #409601] Tue, 23 June 2009 04:49 Go to next message
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;

Re: problem for export to excel functionality-unable to compile the form [message #409634 is a reply to message #409601] Tue, 23 June 2009 06:41 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
DO NOT report your post to get an answer, it is the opposite that happens.

Please read OraFAQ Forum Guide, especially "Posting guidelines" section.

Regards
Michel
Re: problem for export to excel functionality-unable to compile the form [message #409752 is a reply to message #409601] Tue, 23 June 2009 19:57 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Can you get the 'test' form working?

Is this your first form?

Have you searched this forum for 'ole2' or 'd2kwutil'?

David
Previous Topic: 2 Lovs
Next Topic: Running Oracle Reports in Forms
Goto Forum:
  


Current Time: Fri Sep 20 10:35:53 CDT 2024