Page 1 of 1

teechart problem(TeeChart Pro v7 ActiveX Control)

Posted: Mon Apr 03, 2006 5:50 am
by 9529779
can anyone give me a example about how to use the teechart in asp.net?
i had seen the installed-examples. but i still confused about it.

my steps as below:
1. open a new asp.net application (vs2003)
2.place a teechart activex control in html page.(id=TChart1)
3.add in the following code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim TChart1 As New TeeChart.TChart
TChart1.AddSeries(TeeChart.ESeriesClass.scLine)
TChart1.Series(0).FillSampleValues(15)
end sub
-----------------------
but i can't see anything in the teechart after executing this program.

and how to connect to the database in programming

Posted: Mon Apr 03, 2006 3:18 pm
by narcis
Hi,

As TeeChart ActiveX is not an ASP.NET control it doesn't admit runat="server". When the value is runat="server", this attribute specifies that the code contained within the script block runs on the server and not the client. This attribute is required for server-side code blocks. For further information please read .NET Framework's [url=ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_ASPNETgenref/html/fbf5f4c0-5ee6-4f94-b3e8-cdc1dafa7199.htm]Code Declaration Blocks[/url].

To have TeeChart ActiveX working in a ASP.NET application, please look at the example in C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Studio .NET\VBWebForm, genchart.aspx.vb creates a chart with a series and exports it to a memory stream. Then Webform1.aspx, has a VB script which on its OnLoad method imports that previously stored chart.

This is the way that has to be done, creating a chart at the server and exporting it to the client.