Home » Developer & Programmer » Forms » Working with Excel using form 11g (11.1.2.2.0)
Working with Excel using form 11g [message #629214] Thu, 04 December 2014 08:21 Go to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Dear Expert,

I am working with form 11g (11.1.2.2.0).

I have developed a form where it have a button and it is having the following 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; 
cell client_ole2.OBJ_TYPE; 
args client_ole2.OBJ_TYPE; 
ctr NUMBER(12); 
cols NUMBER(2);
name_var1 VARCHAR2(2000); 
name_var2 VARCHAR2(2000); 
name_var3 VARCHAR2(2000); 
name_var4 VARCHAR2(2000); 
filename varchar2(100);

PROCEDURE OLEARG IS
args ole2.OBJ_TYPE; 
BEGIN
args := client_ole2.CREATE_ARGLIST; 
client_ole2.add_arg(args,ctr); -- row value
client_ole2.add_arg(args,cols); -- column value
cell := client_ole2.GET_OBJ_PROPERTY(worksheet,'Cells',args); -- initializing cell
client_ole2.destroy_arglist(args); 
END;

BEGIN
	T_MSG('SHOW_MSG',3);
filename := webutil_file.file_OPEN_dialog(GET_SYS_PARAM_VAL('UP_FILE_DIR'),NULL,'All Files (*.*)|*.*','Open File');
T_MSG('SHOW_MSG',2);                                    
application := client_ole2.CREATE_OBJ('Excel.Application'); 
T_MSG('SHOW_MSG',4);
client_ole2.set_property(application,'Visible','false'); 
T_MSG('SHOW_MSG',5);
workbooks := client_ole2.GET_OBJ_PROPERTY(application, 'Workbooks'); 
T_MSG('SHOW_MSG',6);
args := client_ole2.CREATE_ARGLIST; 
client_ole2.add_arg(args,filename); --'c:\13s002.xls'); -- file path and name
workbook := client_ole2.GET_OBJ_PROPERTY(workbooks,'Open',args); 
T_MSG('SHOW_MSG',7);
client_ole2.destroy_arglist(args); 
args := client_ole2.CREATE_ARGLIST; 
client_ole2.add_arg(args,'Sheet1'); 
T_MSG('SHOW_MSG',8);
worksheet := client_ole2.GET_OBJ_PROPERTY(workbook,'Worksheets',args); 
client_ole2.destroy_arglist(args); 
T_MSG('SHOW_MSG',9);
ctr := 2; --row number
cols := 1; -- column number

OLEARG;
name_var1 := client_ole2.get_char_property(cell,'Value'); --cell value of the argument
T_MSG('SHOW_MSG',name_var1);
cols := cols+1;

client_ole2.INVOKE(application,'Quit'); 
client_ole2.RELEASE_OBJ(cell); 
client_ole2.RELEASE_OBJ(worksheet); 
client_ole2.RELEASE_OBJ(worksheets); 
client_ole2.RELEASE_OBJ(workbook); 
client_ole2.RELEASE_OBJ(workbooks); 
client_ole2.RELEASE_OBJ(application); 
END; 


When I am running the form, I am getting the following messge

Message with '3'

Message with '2'

after the message 2, the rest of the codeing is not working and I am getting the following error in Java console

Forms Session ID is WLS_FORMS.formsapp.9
The proxy host is null, and the proxy port is 0.
Native HTTP implementation is being used for the connection.
The connection mode is HTTP.
Forms Applet version is 11.1.2.2
Exception in thread "AWT-EventQueue-2" java.lang.ExceptionInInitializerError
	at oracle.forms.webutil.ole.OleFunctions.create_obj(Unknown Source)
	at oracle.forms.webutil.ole.OleFunctions.getProperty(Unknown Source)
	at oracle.forms.handler.UICommon.onGet(Unknown Source)
	at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
	at oracle.forms.engine.Runform.processMessage(Unknown Source)
	at oracle.forms.engine.Runform.processSet(Unknown Source)
	at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
	at oracle.forms.engine.Runform.onMessage(Unknown Source)
	at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
	at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
	at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$000(Unknown Source)
	at java.awt.EventQueue$1.run(Unknown Source)
	at java.awt.EventQueue$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$2.run(Unknown Source)
	at java.awt.EventQueue$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission jacob.dll.path read)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
	at java.lang.System.getProperty(Unknown Source)
	at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:143)
	at com.jacob.com.ComThread.<clinit>(ComThread.java:167)
	... 32 more



Kindly guide me to recover from this issue.

Thanks in advance.

Regards,
Kanish

Re: Working with Excel using form 11g [message #629221 is a reply to message #629214] Thu, 04 December 2014 09:31 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
application := client_ole2.CREATE_OBJ('Excel.Application');

This appears to be the line of code where your program halts.

What is your OS version? What is your Browser version? What is your Java version? What is your MS-Office version? Are you running your form from the Forms Builder or from the Application Server?

Looking at your Java Console output...
Quote:
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission jacob.dll.path read)

It looks like WebUtil can't access the Jacob.dll in order to perform the OLE. Have you installed the Jacob.jar and Jacob.dll files on your application server and updated your WebUtil configuration?

Craig...
Re: Working with Excel using form 11g [message #629241 is a reply to message #629221] Thu, 04 December 2014 23:42 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Dear CraigB

Thanks you for you valuable response.


A small general insight about our environment.

-----------------------------
We have two application servers for active and passive purpose.

This servers has been configured through web tire access.

--------------------------------

Quote:
What is your OS version?


Server OS: Windows 2008

Client OS: Windows 7

Quote:
What is your Browser version?


Browser version : IE 8

Quote:
What is your Java version?


Java version : Java 6

Quote:
What is your MS-Office version?


Office version : 2010

Quote:
Are you running your form from the Forms Builder or from the Application Server?


Running from the application server

---------Additional input-------------

My server is 64 bit and client is 32 bit

----------Configuration details----------

we tried with the following all information

jacob.jar
jacob-1.14.3.jar


We tried with both two version of jar.


archive=frmall.jar,frmwebutil.jar,rtaicon.jar,myfirstjar.jar,jacob.jar
WebUtilArchive=jacob.jar,frmwebutil.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384


for 32 bit
jacob-1.14.3-x86.dll
jacob-1.18-M2-x86.dll
for 64 bit
jacob-1.14.3-x64.dll
jacob-1.18-M2-x64.dll




in webutil config file we used
install.syslib.0.0.7.1=jacob-1.14.3-x86.dll|102400|1.14.3|true
install.syslib.0.1.7.1=jacob-1.14.3-x64.dll|117760|1.14.3|true
install.syslib.0.0.9.1=JNIsharedstubs.dll|45056|1.0|true
install.syslib.0.1.9.1=JNIsharedstubs.dll|58368|1.0|true
install.syslib.0.0.9.2=d2kwut60.dll|81920|1.0|true
install.syslib.0.1.9.2=d2kwut60.dll|102400|1.0|true
install.syslib.0.user.1=ffisamp.dll|40960|1.0|true


transfer.database.enabled=TRUE
transfer.appsrv.enabled=TRUE
transfer.appsrv.workAreaRoot=c:\temp
transfer.appsrv.accessControl=TRUE
#List transfer.appsrv.read.<n> directories
transfer.appsrv.read.1=Z:\Repout
transfer.appsrv.read.2=D:\Report_temp\Repout
#List transfer.appsrv.write.<n> directories
transfer.appsrv.write.1=c:\temp


Kindly help me to get rid from this issue.

kanish



[Updated on: Thu, 04 December 2014 23:43]

Report message to a moderator

Re: Working with Excel using form 11g [message #629287 is a reply to message #629241] Fri, 05 December 2014 09:35 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
It appears you have WebUtil configured correctly. Have you tried clearing your Java Cache on the affected Client? You may need to also search the Client File system for "webutil.properties" and delete all instances of this file. If this file exists on the client, the WebUtil related files (.jar and .dll) will not be downloaded to the client.

Craig...
Re: Working with Excel using form 11g [message #629297 is a reply to message #629287] Sat, 06 December 2014 05:52 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Dear CraigB,

I have cleared the Java cache from the client machine even I am facing the same issue.
Re: Working with Excel using form 11g [message #629409 is a reply to message #629297] Mon, 08 December 2014 12:59 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
The only thing I can think of for you to try now is to double-check your configuration and make sure WebUtil was configured correctly and the Jacob files were placed in the correct directories on the Application Server (AS). Also, if you Ftp'd the files to your AS make sure you transferred them in Binary mode versus Text/ASCII mode.

Craig...
Re: Working with Excel using form 11g [message #631366 is a reply to message #629409] Tue, 13 January 2015 02:37 Go to previous message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Are you running forms in server side?

Server sise = client_ole2.CREATE_OBJ

Local (using )C4J instance) = ole2.CREATE_OBJ
Previous Topic: MERGE CELL WHEN EXPORT TO EXCEL
Next Topic: FRM-41104
Goto Forum:
  


Current Time: Sat Apr 20 00:36:27 CDT 2024