OCX in web pages

TeeChart for ActiveX, COM and ASP
Post Reply
Newbie
Newbie
Posts: 4
Joined: Tue Nov 11, 2003 5:00 am

OCX in web pages

Post by » Thu Nov 20, 2003 2:50 pm

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

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Thu Nov 20, 2003 6:28 pm

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

Newbie
Newbie
Posts: 4
Joined: Tue Nov 11, 2003 5:00 am

Post by » Fri Nov 21, 2003 8:39 am

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Nov 21, 2003 10:43 am

>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

Newbie
Newbie
Posts: 4
Joined: Tue Nov 11, 2003 5:00 am

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

Post by » Tue Nov 25, 2003 1:00 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 26, 2003 10:11 am

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

Newbie
Newbie
Posts: 4
Joined: Tue Nov 11, 2003 5:00 am

Machine down?

Post by » Fri Nov 28, 2003 9:14 am

Cannot access this page. I will try again later today.

Øyvind

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Nov 28, 2003 7:32 pm

Please find the example in the steema.public.attachments newsgroups.

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

Post Reply