Page 1 of 1

OCX in web pages

Posted: Thu Nov 20, 2003 2:50 pm
by 8122746
I have made an ASPX page and dragged the OCX on to the page in design mode. The OCX has been configured and named WebChart1. How to I refer to this OCX from the code behind, the server-side script?

I have tried WebChart1.Chart... but it is not connected to the OCX.

Please?

Øyvind

Posted: Thu Nov 20, 2003 6:28 pm
by Marc
Hello Øyvind,

The TeeChart ocx on the webform works like an <object> on a conventional web page. It should call a script (another asp/aspx file) to create the contents that will be exported to the Chart on the browser, a native tee template as a stream.

Eg. The WebForm.aspx page will contain an event:
<pre>
Sub Window_Onload()
Form1.TChart1.Import.LoadFromURL("http://servername/VBWebForm/genchart.aspx")
end sub
</pre>
<br><br>
The file genchart.aspx creates the Chart and exports it to the browser via Binarywrite.

Eg. genchart.aspx.vb
<pre>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim TChart1 As TeeChart.TChartClass
TChart1 = New TeeChart.TChartClass()

TChart1.AddSeries(TeeChart.ESeriesClass.scBar)
TChart1.Series(0).FillSampleValues(10)

Response.BinaryWrite(TChart1.Export.asNative.SaveToStream(True))

End Sub
</pre>
<br><br>
The above example is included as a complete VB Visual Studio.NET project in the TeeChart Pro AX v6.0.0.4 (the current release) VS.NET Examples folder.

Best regards,
Marc Meumann
Steema Support

Posted: Fri Nov 21, 2003 8:39 am
by 8122746
Thanks, I will try this out. But is it also possible to use the TeeChart.NET component in WebForms in a way so that it is a component not just a picture in the browser? When I include the TeeChart.NET component to a WebForm and run the form it is displayed as an image not a object.

Do I have to use the OCX to keep the TeeChart as an object?

Øyvind

Posted: Fri Nov 21, 2003 10:43 am
by Pep
>Thanks, I will try this out. But is it also possible to use the TeeChart.NET >component in WebForms in a way so that it is a component not just a >picture in the browser? When I include the TeeChart.NET component to >a WebForm and run the form it is displayed as an image not a object.

This feature is not yet available. Most likely it will be included for the next release.

>Do I have to use the OCX to keep the TeeChart as an object?
Yes.

Josep Lluis Jorge
http://support.steema.com

Doesn't work. Compiles but doesn't show.

Posted: Tue Nov 25, 2003 1:00 pm
by 8122746
Hi.

I still have grave problems with the ActiveX (ver 5 and 6). I have tried the example of Marc Meumann above and several of the ones in the tutorials but I cannot get them to work.

Nothing happens. The TeeChart component frame comes up but there is no graph or bars.

The problems seems to be that there is connection between the design-time component and the code supplying the data. I use the import on one side and export on the other.

I have even tried to drag the component in design-time and refer to the component in the code-behind editor but it claims that it is not defined.

What am I not doing right?

Øyvind

Posted: Wed Nov 26, 2003 10:11 am
by Pep
Could you please download one example directly from my machine at :

http://80.32.235.114/hola/AXASPNet.zip

Does it works for you ?

Josep Lluis Jorge
http://support.steema.com

Machine down?

Posted: Fri Nov 28, 2003 9:14 am
by 8122746
Cannot access this page. I will try again later today.

Øyvind

Posted: Fri Nov 28, 2003 7:32 pm
by Pep
Please find the example in the steema.public.attachments newsgroups.

Josep Lluis Jorge
http://support.steema.com