Home » Developer & Programmer » Forms » WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work
WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work [message #673443] Tue, 20 November 2018 03:40 Go to next message
rehmankhan
Messages: 22
Registered: July 2018
Junior Member
I am trying to export data displayed in Excel File from oracle forms 10g and Oracle APPS ERP.

I am using CLIENT_OLE2 package for Create and Save Excel File

Here is my CLIENT_OLE2 package image:

https://i.stack.imgur.com/5Ljo7.png

Here is my code:


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 OLE2.OBJ_TYPE;
 J INTEGER;
 K INTEGER;
 file_name_cl VARCHAR2(32767);
 user_cancel EXCEPTION;

BEGIN 
 MESSAGE('AFTER DECLARATION');

 file_name_cl := CLIENT_GET_FILE_NAME('C:\', 'file_name.xls', 'XLS Files 
 (*.xls)|*.xls|', NULL, SAVE_FILE, TRUE);
 file_name_cl := SUBSTR(file_name_cl,1,LENGTH(file_name_cl));

 IF file_name_cl IS NULL THEN
 MESSAGE('INSIDE EXCEPTION STATEMENT');
 RAISE user_cancel;
 END IF;

 MESSAGE('STARTING TRIGGER'); 

 APPLICATION := CLIENT_OLE2.CREATE_OBJ('Excel.Application');
 CLIENT_OLE2.SET_PROPERTY(APPLICATION,'Visible',True);

 MESSAGE('AFTER CREATING 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'); 

 MESSAGE('RIGHT BEFORE GO BLOCK STATEMENT');
 GO_BLOCK('CRITERIA'); 
 FIRST_RECORD; 
 J:=1; 
 K:=1; 
 WHILE :SYSTEM.LAST_RECORD = 'FALSE' 
 LOOP 
 FOR K IN 1..20 /* Form has 7 columns */ 
 LOOP 
 MESSAGE('INSIDE 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..20 
 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,'c:\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); 
 MESSAGE('RIGHT BEFORE END');
 END;


I am getting following error:

WebUtil Error: oracle.forms.webutil.file.FileFunctions bean not found WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work
Re: WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work [message #673445 is a reply to message #673443] Tue, 20 November 2018 04:07 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Looks like the Java stuff you need isn't installed properly.
Re: WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work [message #673459 is a reply to message #673443] Tue, 20 November 2018 07:55 Go to previous message
joy_division
Messages: 4961
Registered: February 2005
Location: East Coast USA
Senior Member
Do non-OLE webutil functions work? If so, then it might be a not properly signed jacob.jar file. It's just a guess though.
Previous Topic: 40735: when-button-pressed trigger raised unhandled exception ORA-305500
Next Topic: send email through Form 6i
Goto Forum:
  


Current Time: Fri Dec 03 21:37:15 CST 2021