Home » Developer & Programmer » Forms » Use of Webutil Library to export to Excel
Use of Webutil Library to export to Excel [message #335250] Mon, 21 July 2008 11:01 Go to next message
Signum
Messages: 13
Registered: July 2008
Junior Member
Hi everyone.

I'm currently working on a form which can export data to an Excel file. I use "CLIENT_OLE2" in order to do that. However, it seems it doesn't work. I'm using Forms 10 and Database 10g too.

On the Java Console, I got this message :

2008-juil.-21  17:24:26.343 WUO[setProperty()] Setting property WUO_OLE2_OBJNAME to Excel.Application

2008-juil.-21  17:24:26.343 WUO[getProperty()] Getting property WUO_OLE2_CREATE_OBJ

2008-juil.-21  17:24:43.640 WUO[setProperty()] Setting property WUO_OLE2_RELEASE_OBJ to 337

Exception occurred during event dispatching:

java.lang.NoSuchMethodError

	at oracle.forms.webutil.ole.OleFunctions.release_obj(Unknown Source)

	at oracle.forms.webutil.ole.OleFunctions.setProperty(Unknown Source)

	at oracle.forms.handler.ComponentItem.setCustomProperty(Unknown Source)

	at oracle.forms.handler.ComponentItem.onUpdate(Unknown Source)

	at oracle.forms.handler.JavaContainer.onUpdate(Unknown Source)

	at oracle.forms.handler.UICommon.onUpdate(Unknown Source)

	at oracle.forms.engine.Runform.onUpdateHandler(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.dispatchEvent(Unknown Source)

	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

	at java.awt.EventDispatchThread.run(Unknown Source)



Here is the code from the form module :

Declare
   app CLIENT_OLE2.OBJ_TYPE;
Begin
   app:=CLIENT_OLE2.CREATE_OBJ('Excel.Application');
   message(app);
   CLIENT_OLE2.Release_Obj(app);
   message('test2');
End;


When I call "CLIENT_OLE2.Create_Obj", it worked (I can see it with the Excel process on the process list) but whenever I use the Excel object (i.e "app" variable in my example), nothing happen (or should I say that the program stopped when I called "Release_Obj" or whatever the function/procedure. If I use "app", then the "message('test2')" instruction doesn't work). I tried the other Webutil functions (WEBUTIL_HOST, WEBUTIL_FILE, etc...) and there is no problem, so Webutil is correctly installed.

So, what's the problem here ? Are there another way to export data to Excel ?

Thanks for your help ^^
Re: Use of Webutil Library to export to Excel [message #335258 is a reply to message #335250] Mon, 21 July 2008 11:30 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Are you sure you can use app as a parameter for message() ? Isn't that the point where it errors out?
Re: Use of Webutil Library to export to Excel [message #335281 is a reply to message #335250] Mon, 21 July 2008 12:51 Go to previous messageGo to next message
Signum
Messages: 13
Registered: July 2008
Junior Member
I'm sure about it. It displays a number (Maybe it's the process number or something like that) and it's not equal to 0 when I try. Even if I change "message(app)" by "message('something')", there would be the same error when I try to use "app" in a function/procedure like "CLIENT_OLE2.Set_Property" or "CLIENT_OLE2.Release_Obj".

[Updated on: Mon, 21 July 2008 12:55]

Report message to a moderator

Re: Use of Webutil Library to export to Excel [message #335297 is a reply to message #335250] Mon, 21 July 2008 14:46 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Maybe you can try to Quit the application before releasing the object


  client_OLE2.INVOKE(app, 'Quit');
  client_OLE2.RELEASE_OBJ(app);

Re: Use of Webutil Library to export to Excel [message #335308 is a reply to message #335250] Mon, 21 July 2008 15:32 Go to previous messageGo to next message
Signum
Messages: 13
Registered: July 2008
Junior Member
I just tried to quit the application before releasing the object but I got the same error :/ I don't know what's wrong... The only thing I can do is to create an object...
Re: Use of Webutil Library to export to Excel [message #335646 is a reply to message #335250] Wed, 23 July 2008 02:24 Go to previous messageGo to next message
Signum
Messages: 13
Registered: July 2008
Junior Member
I just got another solution : Now, I'm using CLIENT_TEXT_IO and create a .CSV file instead of a .XLS file Razz It works fine ^^
Re: Use of Webutil Library to export to Excel [message #340257 is a reply to message #335646] Tue, 12 August 2008 02:09 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

For the CLIENT_OLE2 functionality to work using WEBUTIL , you have to use jacob.You can search the internet for jacob. read the document attached...
  • Attachment: web_util.pdf
    (Size: 1.12MB, Downloaded 1765 times)
Re: Use of Webutil Library to export to Excel [message #384189 is a reply to message #335646] Mon, 02 February 2009 11:34 Go to previous messageGo to next message
jimr1234567890
Messages: 1
Registered: February 2009
Junior Member
I can save the file out to disk no problems.

What I wanted was to open the resulting file with the correct application.

I tried (for an excel generated file):
v_app := client_ole2.create_obj ('Excel.Application');
...

When the package gets to client_ole2.create_obj it crashes when executing it locally. Appears to work fine on the server.

The client_ole2.create_obj gets around to calling:
v_javaHandle := WebUtil_Core.getProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_CREATE_OBJ');

This WebUtil_Core.getProperty gets around to calling:
result := GET_CUSTOM_PROPERTY(bean,1,propertyName);

At this point my application stops/freezes. The 'propertyName' at this point equal: WUO_OLE2_CREATE_OBJ

Any reason what is missing? I am using the stander Webutil 1.0.6 and the Jacob 1.8 files.







Re: Use of Webutil Library to export to Excel [message #384440 is a reply to message #384189] Tue, 03 February 2009 19:08 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post your code.

How do you know that this is the statement that is causing the failure?

Search this forum for 'client_ole2.create_obj' plus other keywords that you have used and see how other people have handled it.

David
Previous Topic: LOV validation
Next Topic: show_windows not work ??
Goto Forum:
  


Current Time: Fri Apr 28 03:39:36 CDT 2017

Total time taken to generate the page: 0.07556 seconds