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
OCX in web pages
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
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
- Posts: 4
- Joined: Tue Nov 11, 2003 5:00 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
Do I have to use the OCX to keep the TeeChart as an object?
Øyvind
>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
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
- Posts: 4
- Joined: Tue Nov 11, 2003 5:00 am
Doesn't work. Compiles but doesn't show.
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
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
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
http://80.32.235.114/hola/AXASPNet.zip
Does it works for you ?
Josep Lluis Jorge
http://support.steema.com
-
- Newbie
- Posts: 4
- Joined: Tue Nov 11, 2003 5:00 am
Machine down?
Cannot access this page. I will try again later today.
Øyvind
Øyvind
Please find the example in the steema.public.attachments newsgroups.
Josep Lluis Jorge
http://support.steema.com
Josep Lluis Jorge
http://support.steema.com