Populating activex on web page not gives weird functionality

TeeChart for ActiveX, COM and ASP
Post Reply
Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

Populating activex on web page not gives weird functionality

Post by Franz Thomsen » Wed May 24, 2006 12:54 am

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>

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

Post by Pep » Sun May 28, 2006 12:10 pm

Hi Franz,

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>
?

Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

quite weird

Post by Franz Thomsen » Tue Jun 06, 2006 12:09 pm

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>

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

Post by Pep » Thu Jun 08, 2006 2:32 pm

Hi Fran<,

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>
It works fine here.

Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

it works

Post by Franz Thomsen » Fri Jun 09, 2006 5:49 am

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

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

Post by Pep » Fri Jun 09, 2006 9:06 am

Hi Franz,

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> 

Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

it doesn't here

Post by Franz Thomsen » Fri Jun 09, 2006 9:12 am

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 (?)

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

Post by Pep » Fri Jun 09, 2006 12:38 pm

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 :

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> 

Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

guid

Post by Franz Thomsen » Fri Jun 09, 2006 2:28 pm

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"

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jun 12, 2006 10:01 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FranzThomsen
Newbie
Newbie
Posts: 3
Joined: Wed Mar 01, 2006 12:00 am

It works fint for 6.0.0.6

Post by FranzThomsen » Mon Dec 18, 2006 10:19 am

It works fint for 6.0.0.6. thanks

Post Reply