TChart in Applet using DCOM and JIntegra almost working
Posted: Mon Nov 17, 2003 8:34 am
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
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