Discussions
Categories
- 197.2K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Webutil OLE2 in Forms 12
Hi All
I am migrating an oracle forms 6i application to a forms 12.1.2.4 application
In forms 6i, I have the screen that generate an xml file
and display it in an OLE Object (Excel.Sheet.8) in a forms 6i screen
Is it possible to display an xml file with the same way in Forms 12c? Else I will open directly the XML file with Web.Show_Document, not a big problem i know do this.
BUT before this I have the problem to generate the XML file
In forms 6i Library OLE2 was used. I tried to replace OLE2 library with CLIENT_OLE2 package from library WEBUTIL
But when I execute it I got the following error message :
When trying to execute the following line :
application := CLIENT_OLE2.create_obj('Excel.Application');
I know that my Webutil is correctly configure as I can use the following webutil function withouth any error :
WEBUTIL_FILE.FILE_OPEN_DIALOG
Any Idea why this error occurs?
On my PC I have Microsoft Office Professionnel Plus 2016 installed
On the Application server Excel is not installed. Could it be the cause?
Thanks,
Best regards,
Best Answer
-
Hi,
Thanks for your help but problem was not on webutil configuration.
As explained I already set Webutil with in others screen WEBUTIL_FILE.FILE_OPEN_DIALOG and it works well.
I found the solution on http://www.orafaq.com/forum/t/138991/2/
My function was automatically launched in when new-form-instance.
But as explained in the article, Webutil cannot be launched in triggers : PRE-FORM, WHEN-NEW-FORM-INSTANCE and WHEN-NEW-BLOCK-INSTANCE for the first block in the Form
However, there is an important restriction in the use of WebUtil functions: WebUtil can only start to communicate with the client once the Form has instantiated the WebUtil PJCs.
This means that you cannot call WebUtil functions before the Forms user interface is rendered.
So, I copied the code of WHEN-NEW-FORM-INSTANCE into WHEN-TIMER-EXPIRED trigger and use the following code in WHEN-NEW-FORM-INSTANCE
declare
fake_timer TIMER;
begin
--
-- Purpose of the fake timer is the we cannot call webutil in this trigger since the
-- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger
-- it means that this timer will not start running until Forms has focus (and so the webutil
-- beans will be instantiated and so call canbe made.
--
fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
--create_blob_table;
null;
end;
So now I do not have the error but all is not working well, I don't have error but my file is not generated.
Will take a look and let you know.
Best regards,
Answers
-
Any old Forms applications that previously used ActiveX control objects or OLE objects must first remove these objects from the form before upgrading. These object types are not supported in web deployed Forms applications. This is explained in the document titled "Upgrading Oracle Forms 6i Applications" found here:
https://docs.oracle.com/en/middleware/developer-tools/forms/12.2.1.4/index.html
I encourage you to review this document before proceeding.
Regarding the creation of an Excel sheet on the user's machine with WebUtil, take a look at MyOracleSupport Note 270986.1 The note includes example code illustrating one possible way to accomplish what you are requesting.
Also, you mentioned an "error" but never shared the details of the error.
-
Yes I know tat OLE object are not supported in Forms Web applications, It is why i wrote that if it is not possible to display them it is not a problem as I know I can launch XML file with web.show_document
I just wonder be sure it was not possible.
Regarding the error, I forgot to add the screenshot, Sorry
So now I will take a look at the note 270986.1 you passed to me
Thanks,
Best regards,
-
And sorry I just saw I mastyped above, it is not an XML file I want to write but an XLS file (with graphics)
But not sure it will be different
Best regards,
-
The error you shared can be caused by anyone or more of the following:
1. You ran the form with a configuration that is not WebUtil enabled. The installation provides example configurations that you can use to test. For example: [webutil] or [webutil_webstart]
http://example.com/forms/frmservlet?form=myForm&config=webutil_webstart
2. You did not perform a compile_all=yes on the form before generating the FMX. This can be done in the Builder from the menu or using Shift+Ctrl+k. If doing this in the Builder, you should Save after executing then generate the FMX
3. You did not include the WebUtil object group from the WebUtil Object Library (webutil.olb) in your form. Specifically you must include the group that includes OLE.
Although not related to the error, but understand that in order to perform OLE operations on the user's machine you will need to download and sign the Jacob libraries. Refer to the documentation for setup details. There is also a MyOracleSupport Note that explains this.
-
Hi,
Thanks for your help but problem was not on webutil configuration.
As explained I already set Webutil with in others screen WEBUTIL_FILE.FILE_OPEN_DIALOG and it works well.
I found the solution on http://www.orafaq.com/forum/t/138991/2/
My function was automatically launched in when new-form-instance.
But as explained in the article, Webutil cannot be launched in triggers : PRE-FORM, WHEN-NEW-FORM-INSTANCE and WHEN-NEW-BLOCK-INSTANCE for the first block in the Form
However, there is an important restriction in the use of WebUtil functions: WebUtil can only start to communicate with the client once the Form has instantiated the WebUtil PJCs.
This means that you cannot call WebUtil functions before the Forms user interface is rendered.
So, I copied the code of WHEN-NEW-FORM-INSTANCE into WHEN-TIMER-EXPIRED trigger and use the following code in WHEN-NEW-FORM-INSTANCE
declare
fake_timer TIMER;
begin
--
-- Purpose of the fake timer is the we cannot call webutil in this trigger since the
-- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger
-- it means that this timer will not start running until Forms has focus (and so the webutil
-- beans will be instantiated and so call canbe made.
--
fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
--create_blob_table;
null;
end;
So now I do not have the error but all is not working well, I don't have error but my file is not generated.
Will take a look and let you know.
Best regards,
-
Ok so, I says too fast :
I didn't see a pop-up window :
So if I click on "Continuer", my file is created
So now a new Question :
Is there a way to not display this screen?
I thought it is because it is a .XLS that is generated. Is there a way to generate an XLSX file easily maybe?
FYI: I have Microsoft Office Professionnel Plus 2016 installed on my PC
Thanks,
Best regards,
-
The message you are getting is coming from Microsoft and not Forms. It appears to be the result of the format used to create your spreadsheet. Likely the only way to avoid this would be to create the sheet using the formatting of a newer Excel version. If you are generating the sheet from the calls made from Oracle Forms, you likely need to modify your OLE code. Remember that the code example provided in the MyOracleSupport Note is just an "example" and was written many years ago. You would need to refer to the Microsoft OLE documentation in order to properly update your OLE code.
For everyone else's benefit, I have attempted to translate the Microsoft message shared above:
The following features of this workbook are not supported in earlier versions of Excel. These features may be lost or degraded if you save the workbook in an earlier file format. Click Continue to save the workbook anyway. To keep all functionality, click Cancel, and then save the file in one of the new formats.Significant loss of functionalityIn earlier versions of Excel, only row colors from the color palette are supported. When opening the workbook in an earlier version of Excel each row color is matched to the closest color on the color palette. A graph can thus display several series in the same color.Location: 'GRAPH_GEPLOG', Shapes
-
Ok, I will take a look at the documentation but not a priority as xls file is correctly generated
Thanks for your help
Best regards,