Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

ActiveX and ASP+

Hi,

I use an ActiveX Control to generate a chart picture.
How can I use this ActiveX Control in ASP+ and C# ?

I din't found any examples to learn from, so maybe you can help me. ;)

The code below runs fine under ASP 3.0.

Thanks a lot,

Andr Borchert

--

<% @ Language = VBScript %>
<html>
<head>
</head>
<body>

<object runat=server
type="application/x-oleobject"
classid="CLSID:008BBE7E-C096-11D0-B4E3-00A0C901D681"
codebase="TeeChart.ocx"
id=Chart1
width=500
height=250
hspace=0
vspace=0>
</object>

<script language="VBScript" runat=server>
Chart1.RemoveAllSeries
Chart1.AddSeries(1)
Chart1.Series(0).Clear
Chart1.Series(0).Add 300, "Apples", RGB(255,0,0)
Chart1.Series(0).Add 600, "Pears", RGB(255,255,255)
Chart1.Series(0).Add 400, "Bananas", RGB(255,255,0)
Chart1.Header.Text.Clear
Chart1.Header.Text.Add("2000 Sales")
Chart1.Export.SaveToJPEGFile "D:\TerraBay\Web\chart.jpg", False,
jpegBestQuality, 95, Chart1.Width, Chart1.Height
</script>

<p><img border="0" src="/chart.jpg"></p>

</body>
</html>
[1293 byte] By [Andr Borchert] at [2007-11-9 16:23:56]
# 1 Re: ActiveX and ASP+
Andre:

You are going to need to use this namespace for starters.
<%@import namespace="System.Data"%>

Using objects in ASP+ requires namespaces.
this is the namespace for ADO. Put it at the top
of the page.

Rob

"Andr Borchert" <info@terrabay.com> wrote:
>Hi,
>
>I use an ActiveX Control to generate a chart picture.
>How can I use this ActiveX Control in ASP+ and C# ?
>
>I din't found any examples to learn from, so maybe you can help me. ;)
>
>The code below runs fine under ASP 3.0.
>
>Thanks a lot,
>
>Andr Borchert
>
>--
>
><% @ Language = VBScript %>
><html>
><head>
></head>
><body>
>
><object runat=server
> type="application/x-oleobject"
> classid="CLSID:008BBE7E-C096-11D0-B4E3-00A0C901D681"
> codebase="TeeChart.ocx"
> id=Chart1
> width=500
> height=250
> hspace=0
> vspace=0>
></object>
>
><script language="VBScript" runat=server>
> Chart1.RemoveAllSeries
> Chart1.AddSeries(1)
> Chart1.Series(0).Clear
> Chart1.Series(0).Add 300, "Apples", RGB(255,0,0)
> Chart1.Series(0).Add 600, "Pears", RGB(255,255,255)
> Chart1.Series(0).Add 400, "Bananas", RGB(255,255,0)
> Chart1.Header.Text.Clear
> Chart1.Header.Text.Add("2000 Sales")
> Chart1.Export.SaveToJPEGFile "D:\TerraBay\Web\chart.jpg", False,
>jpegBestQuality, 95, Chart1.Width, Chart1.Height
></script>
>
><p><img border="0" src="/chart.jpg"></p>
>
></body>
></html>
>
>
Rob at 2007-11-11 23:26:18 >
# 2 Re: ActiveX and ASP+
look at the posts on August 17th by
Rob scoble as well.

Rob

"Andr Borchert" <info@terrabay.com> wrote:
>Hi,
>
>I use an ActiveX Control to generate a chart picture.
>How can I use this ActiveX Control in ASP+ and C# ?
>
>I din't found any examples to learn from, so maybe you can help me. ;)
>
>The code below runs fine under ASP 3.0.
>
>Thanks a lot,
>
>Andr Borchert
>
>--
>
><% @ Language = VBScript %>
><html>
><head>
></head>
><body>
>
><object runat=server
> type="application/x-oleobject"
> classid="CLSID:008BBE7E-C096-11D0-B4E3-00A0C901D681"
> codebase="TeeChart.ocx"
> id=Chart1
> width=500
> height=250
> hspace=0
> vspace=0>
></object>
>
><script language="VBScript" runat=server>
> Chart1.RemoveAllSeries
> Chart1.AddSeries(1)
> Chart1.Series(0).Clear
> Chart1.Series(0).Add 300, "Apples", RGB(255,0,0)
> Chart1.Series(0).Add 600, "Pears", RGB(255,255,255)
> Chart1.Series(0).Add 400, "Bananas", RGB(255,255,0)
> Chart1.Header.Text.Clear
> Chart1.Header.Text.Add("2000 Sales")
> Chart1.Export.SaveToJPEGFile "D:\TerraBay\Web\chart.jpg", False,
>jpegBestQuality, 95, Chart1.Width, Chart1.Height
></script>
>
><p><img border="0" src="/chart.jpg"></p>
>
></body>
></html>
>
>
Rob at 2007-11-11 23:27:12 >
# 3 Re: ActiveX and ASP+
The solution has been found at http://www.aspheute.com/artikel/20000828.htm
where Christoph Wille described (in german) how to use COM components in
ASP+.

My ActiveX control now runs fine server-side in ASP+.
Thanks a lot to all people who helped me to slove this problem !

Andr

http://freespeech.org/terrabay
International Internet Statistics
--

"Andr Borchert" <info@terrabay.com> wrote in message
news:39a6ca7c@news.dev-archive.com...
> Hi,
>
> I use an ActiveX Control to generate a chart picture.
> How can I use this ActiveX Control in ASP+ and C# ?
>
> I din't found any examples to learn from, so maybe you can help me. ;)
>
> The code below runs fine under ASP 3.0.
>
> Thanks a lot,
>
> Andr Borchert
>
> --
Andr Borchert at 2007-11-11 23:28:21 >