Download from Oracle 10g Forms to Excell
300230Jan 3 2008 — edited Jun 17 2010Hi All,
Currently we are using Oracle 6i Client/Server and in most of the forms we have a button that downloads the data to EXCELL.
We have migrated from Oracle 6i to Oracle 10g AS and the server is AIX060 Unix.
I want the users to download the data same way as was before, but I want the excell to be launched from the client side.
I have been reading all possible links on the forum regarding this issue and I am getting a lot confused...
I tried copying some of the code from the forums that is working good...
but when compiled I get this error...
Below is the code I copied:
PROCEDURE OLE_AUFRUF_Web IS
l_filename varchar2(200);
FLAG BOOLEAN;
directory_name varchar2(200);
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 ole2.Obj_Type;
j INTEGER;
k INTEGER;
begin
l_filename := webutil_file.file_save_dialog
(directory_name => 'C:\'
,file_name => :master.docno|| '.xls'
,file_filter => null
,title => 'Select client side filename where App Server file will be saved'
);
/* Calling Excel and adding a new worksheet to a blank workbook */
application := Client_OLE2.create_obj('Excel.Application');
CLIENT_OLE2.SET_PROPERTY(APPLICATION, 'VISIBLE', false);
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('MASTER');
j:=1;
k:=1;
for k in 1..246 /* Table has 246 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;
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,l_filename);
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);
/* Display successfull message */
message('File successfully saved as ' || l_filename);
END;
The Error I get is:
Error 201 at line 6 column 13
Identifer 'CLIENT_OLE2.OBJ_TYPE' must be declared
and so on...
My question is the Webutil is used only for the client side not on unix server?
Can someone point me to some documentations for this or give me a hint...
write now I just want to develope a test form that can perform this task and understand the basic concept behind this as this is totally new to me.
Thanks to all...
I appriciate your responses...
Habeeb