Page 1 of 1

TChart in Applet using DCOM and JIntegra almost working

Posted: Mon Nov 17, 2003 8:34 am
by 6925667
Hello,

We are moving from Oracle client/server to Oracle webforms. The TeeChart ocx component in our forms serving the graphics then no longer works. Our solution is to have a Java Bean on the Form take care of this. To see how things should work we started out with just a Java application and then a Java applet. The applet comes very close to what we like in the Oracle webform. This seems to be our only solution to keep TeeChart in our development, otherwise we'll have to switch to another graphics suite.

What we have done so far is: We used JIntegra to generate wrapper/proxy classes based on the file TeeChart5.ocx This gives us about 500 classes. Using these classes in a Java application on a local machine works fine, the graphics are shown. Not too difficult since all the software is on the local machine and we don't have to make a remote connection or method call. So in java we do: TChart chart = new TChart() and the chart component can be added to the contentpane on the Java Frame to become visible. So far so good.

But now we want to have the same thing working in a Java applet, so the client machine only has a browser and a JavaVM to run the applet which uses DCOM to access the TeeChart ocx. We regenerate the classes since JIntegra says the AWT option should be disabled when you want to run an ActiveX over the network. Now the class TChart accepts 'host' as a parameter which looks ok, because that's what we want. The file TeeChart5.ocx is registered as a dcom service on the server machine and privileges are set so the service is accessible.

To make an authorized connection we use: AuthInfo.setDefault(<domain>,<username>,<password>)

Next we try to execute the TChart on the server by: TChart tChart = new TChart(host);

This all causes no exceptions and the Windows eventviewer shows a succesful login from the applet requesting the dcom service. This looks very good so far. But TChart no longer is derived from type Component, but simply an Object. (Components can be added to an applet frame so they become visible). So all we have is a pointer to a TChart object, but no way to put this as a graph on the Applet.

One thing we tried was to cast the TChart as a Canvas to a Component object and then add it to the contentpane: this.getContentPane().add((java.awt.Component)tChart.getCanvas())

But this gives an unknown error in the ICanvasProxy class.

Please advice on how to handle the returned TChart to make it visible in the Java applet.

Thanks in advance for your help,

Raoul Suurmeijer
Philips Netherlands

Posted: Mon Nov 17, 2003 1:54 pm
by Chris
Hi Raoul,

Just a quick question before going into the technical details of the issue -- given that you have a TChart object serverside, have you considered exporting your chart as an image or do you really want a "live" (zoomable, scollable) chart on the client?

Best regards,

Christopher Ireland
http://support.steema.com

Posted: Fri Nov 21, 2003 8:13 am
by 6925667
Hi Christopher,

We have considered generating an image on the server (with a unique name in case of multiple users), then load this in de webform using http as any normal image on the web. However this is not a real option, we want to have more control capabilities (event listeners) on the chart for registering exact mouseclicks etc.

The zooming and scrolling is probably going to be a problem one way or another. In the end the chart must always be a Java Bean to be integrated into the Oracle Webform, so it's the Java Bean that will have to register all events and pass these on to the chart engine.

We are now looking at a 100% Java solution. With the use of a collection of chart libraries we are trying to do everything in the browser instead of making calls to the dcom-TeeChart server. This reduces application complexity. The dcom-service requires extra server ports which may give as some trouble with firewalls in the future.

But ofcourse, if you see possibilities to keep TeeChart running the way we we want it, that would be great. There has been a lot of effort put into making all Oracle forms call these TeeChart libraries.

Thanks, best regards,
Raoul Suurmeijer
Philips Netherlands

Posted: Tue Nov 25, 2003 3:05 pm
by Chris
6925667 wrote: But ofcourse, if you see possibilities to keep TeeChart running the way we we want it, that would be great. There has been a lot of effort put into making all Oracle forms call these TeeChart libraries.
We are taking a closer look at JIntegra to see if we can suggest something that may help. A 100% Java solution may be more applicable to your plans but we are interested to see anyway what possibilities may be offered with TeeChart via a JIntegra Java solution.

Best regards,

Christopher Ireland
http://support.steema.com