Populating activex on web page not gives weird functionality
-
- Newbie
- Posts: 6
- Joined: Wed Mar 01, 2006 12:00 am
Populating activex on web page not gives weird functionality
Hi
I am using TeeChart ActiveX as part of a web page. During page load I want to populate the TeeChart ActiveX by just letting it load a tee file from the server. In the example below I am just trying to let it load a tee file generated by the activex from one of the demos. Porblem is that when I use LoadFromFile in body onload event it gives weird functionality regarding zoom and pan. If I do the same LoadFromFile when just clicking a button it works fine. I need to have the teechart populated automatically in the web page. What do I do. Below is the problem.
The method add is run during onload where it doesn't work but when clicking the button afterwards it works fine.
Thanks in advance.
Best Regards
Franz Thomsen
<html>
<body onload="add();">
<script language="JavaScript">
function add()
{
document.getElementById("Chart1").Import.LoadFromFile("C:\\Program Files\\Steema Software\\TeeChart Pro v6 ActiveX Control\\Cab files\\a.tee");
}
</script>
<input type="button" value="Load" onclick="add();">
<object
id="Chart1"
width="400"
height="268"
type="application/x-oleobject"
hspace="0"
vspace="0"
classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD"
codebase="Teechart6.cab#version=6,0,0,5">
</object>
</body>
</html>
I am using TeeChart ActiveX as part of a web page. During page load I want to populate the TeeChart ActiveX by just letting it load a tee file from the server. In the example below I am just trying to let it load a tee file generated by the activex from one of the demos. Porblem is that when I use LoadFromFile in body onload event it gives weird functionality regarding zoom and pan. If I do the same LoadFromFile when just clicking a button it works fine. I need to have the teechart populated automatically in the web page. What do I do. Below is the problem.
The method add is run during onload where it doesn't work but when clicking the button afterwards it works fine.
Thanks in advance.
Best Regards
Franz Thomsen
<html>
<body onload="add();">
<script language="JavaScript">
function add()
{
document.getElementById("Chart1").Import.LoadFromFile("C:\\Program Files\\Steema Software\\TeeChart Pro v6 ActiveX Control\\Cab files\\a.tee");
}
</script>
<input type="button" value="Load" onclick="add();">
<object
id="Chart1"
width="400"
height="268"
type="application/x-oleobject"
hspace="0"
vspace="0"
classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD"
codebase="Teechart6.cab#version=6,0,0,5">
</object>
</body>
</html>
Hi Franz,
how about using similar code to the following :
?
how about using similar code to the following :
Code: Select all
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload()
'sets up Chart to print from IE's print option
TChart1.Environment.IEPrintWithPage=True
LoadFile
End sub
Sub LoadFile()
path=window.location.pathname
while instr(1,path,"%20") > 0
path=replace(path,"%20"," ")
wend
while right(path,1) <> "\"
path=left(path,len(path)-1)
wend
path=right(path,len(path)-1)
TChart1.Import.LoadFromFile(path & "test.tee")
end sub
-->
</SCRIPT>
<html><head><LINK REL=STYLESHEET TYPE="text/css" HREF="style.css"></head>
<BODY bgcolor=#FFFFFF>
<p>
<font face="Arial" color="#004080"><em><big><strong>Load Chart from File Example</strong></big></em></font></h3>
</p>
<p><input type="button" value="Retrieve a Chart from the local test.tee file" onclick="LoadFile" name="cdmChart1"> </p>
</p>
<OBJECT ID="TChart1" WIDTH=450 HEIGHT=290
CLASSID="CLSID:FAB9B41C-87D6-474D-AB7E-F07D78F2422E" >
</OBJECT>
</BODY>
</html>
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 6
- Joined: Wed Mar 01, 2006 12:00 am
quite weird
I found out that if I do the following in VBScript it works, but not in javascript
<html>
<head>
<title>TeeChart Pro Internet CAB file test page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="style.css"></head>
<body bgcolor=#FFFFFF>
<object id="Chart1" width="400" height="268" type="application/x-oleobject" hspace="0" vspace="0" classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD" codebase="Teechart6.cab#version=6,0,0,5"></object>
<script language="VBScript">
Chart1.Import.LoadFromFile("C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Cab files\a.tee")
Sub Chart1_OnClickSeries(SeriesIndex, ValueIndex, Button, Shift, X, Y)
end sub
</script>
</body>
</html>
<html>
<head>
<title>TeeChart Pro Internet CAB file test page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="style.css"></head>
<body bgcolor=#FFFFFF>
<object id="Chart1" width="400" height="268" type="application/x-oleobject" hspace="0" vspace="0" classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD" codebase="Teechart6.cab#version=6,0,0,5"></object>
<script language="VBScript">
Chart1.Import.LoadFromFile("C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Cab files\a.tee")
Sub Chart1_OnClickSeries(SeriesIndex, ValueIndex, Button, Shift, X, Y)
end sub
</script>
</body>
</html>
Hi Fran<,
how about using similar code to the following ? :
It works fine here.
how about using similar code to the following ? :
Code: Select all
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function DisplayChart()
{
TChart1.Import.LoadFromFile("D:\\test.tee")
}
function TChart1_OnScroll()
{
if(TChart1.Axis.Top.Maximum > 15) TChart1.Scroll.Enable = false;
if(TChart1.Axis.Top.Minimum < - 1) TChart1.Scroll.Enable = false;
}
function TChart1_OnMouseDown(Button,Shift,X,Y)
{
TChart1.Scroll.Enable = true;
}
</SCRIPT>
</head>
<body onLoad = "DisplayChart()">
<SCRIPT LANGUAGE="JavaScript" FOR="TChart1" EVENT="OnScroll()" >
TChart1_OnScroll()
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" FOR="TChart1" EVENT="OnMouseDown(Buttom,Shift,X,Y)" >
TChart1_OnMouseDown(Shift,X,Y)
</SCRIPT>
<OBJECT ID="TChart1" WIDTH="50%" HEIGHT="50%"
CLASSID="CLSID:B6C10489-FB89-11D4-93C9-006008A7EED4"
</OBJECT>
</body>
</html>
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 6
- Joined: Wed Mar 01, 2006 12:00 am
it works
Well, that works in javascript, but if I omit the two event handlers
<SCRIPT LANGUAGE="JavaScript" FOR="Chart1" EVENT="OnScroll()" >
Chart1_OnScroll()
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" FOR="Chart1" EVENT="OnMouseDown(Buttom,Shift,X,Y)" >
Chart1_OnMouseDown(Shift,X,Y)
</SCRIPT>
it doesn't work anymore even though it should not have anything to do with body onload
Franz Thomsen
<SCRIPT LANGUAGE="JavaScript" FOR="Chart1" EVENT="OnScroll()" >
Chart1_OnScroll()
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" FOR="Chart1" EVENT="OnMouseDown(Buttom,Shift,X,Y)" >
Chart1_OnMouseDown(Shift,X,Y)
</SCRIPT>
it doesn't work anymore even though it should not have anything to do with body onload
Franz Thomsen
Hi Franz,
strange, just removing these lines works fine here. With this code :
strange, just removing these lines works fine here. With this code :
Code: Select all
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function DisplayChart()
{
TChart1.Import.LoadFromFile("D:\\test.tee")
}
</SCRIPT>
</head>
<body onLoad = "DisplayChart()">
<OBJECT ID="TChart1" WIDTH="50%" HEIGHT="50%"
CLASSID="CLSID:B6C10489-FB89-11D4-93C9-006008A7EED4"
</OBJECT>
</body>
</html>
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 6
- Joined: Wed Mar 01, 2006 12:00 am
it doesn't here
But please note that I am not using the same GUID as you. I am instantiating the activex from C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Cab files\teechart6.cab date 3/11-2004. The GUID you are using may be of a later version (?)
Hi Franz,
here I've tried with the latest v6.06 and it works fine, could you please download the latest TeeChart Pro v6.0.0.6 from the private customers download page and test if it works fine with this version ? (remember to unisntall first the v6.0.0.5).
Code used :
here I've tried with the latest v6.06 and it works fine, could you please download the latest TeeChart Pro v6.0.0.6 from the private customers download page and test if it works fine with this version ? (remember to unisntall first the v6.0.0.5).
Code used :
Code: Select all
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function DisplayChart()
{
TChart1.Import.LoadFromFile("D:\\test.tee")
}
</SCRIPT>
</head>
<body onLoad = "DisplayChart()">
<object
id="TChart1"
width="400"
height="268"
type="application/x-oleobject"
hspace="0"
vspace="0"
classid="CLSID:536600D3-70FE-4C50-92FB-640F6BFC49AD"
codebase="Teechart6.cab#version=6,0,0,6">
</object>
</body>
</html>
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 6
- Joined: Wed Mar 01, 2006 12:00 am
guid
I installed the .6 version but it doesn't load the activex. When I search for the guid you use in your example in my registry it is the one for the TeeChart5.ocx and not the TeeChart6.ocx. I had it once on my computer which is why I have it in registry
[HKEY_CLASSES_ROOT\CLSID\{B6C10489-FB89-11D4-93C9-006008A7EED4}]
@="TeeChart Pro Activex control v5"
[HKEY_CLASSES_ROOT\CLSID\{B6C10489-FB89-11D4-93C9-006008A7EED4}\InprocServer32]
@="C:\\Inetpub\\wwwroot\\DSS\\COM\\TeeChart5.ocx"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{B6C10489-FB89-11D4-93C9-006008A7EED4}]
@="TeeChart Pro Activex control v5"
[HKEY_CLASSES_ROOT\CLSID\{B6C10489-FB89-11D4-93C9-006008A7EED4}\InprocServer32]
@="C:\\Inetpub\\wwwroot\\DSS\\COM\\TeeChart5.ocx"
"ThreadingModel"="Apartment"
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Franz,
Please notice that Pep's last message uses a different GUID. Could you please check that you are using it?
Thanks in advance.
Please notice that Pep's last message uses a different GUID. Could you please check that you are using it?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 3
- Joined: Wed Mar 01, 2006 12:00 am
It works fint for 6.0.0.6
It works fint for 6.0.0.6. thanks