Page 1 of 1

Unable to cast COM object of type

Posted: Tue Mar 06, 2007 5:17 am
by 9527390
I am using TChart ActiveX control in ASP.NET application (using C#).

When the page is invoked, I am getting the following JScript error in the line LoadFromURL

"Error: Wrong *.tee file format"

If I access the page which is called in LoadFromURL, I get the following server side error.

Unable to cast COM object of type 'TeeChart.TChartClass' to interface type 'TeeChart.ITChart'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{E95AD73C-AE6B-4EFB-B1BB-28E94EFF52EA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I am using 7.0.1.3 version.

Please provide a solution as early as possible.

Regards,
Kaja

Posted: Tue Mar 06, 2007 10:21 am
by narcis
Hi Kaja,

You should use TeeChart Pro v7 ActiveX in WebForms applications as shown in the VB.NET WebForms examples at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Studio .NET (Default English installation path).

If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Thu Mar 08, 2007 11:56 am
by 9527390
I uploaded a sample to the url http://www.steema.net/upload/Default.aspx. The zip file name is ActiveX_IE7.zip

The code I used is from your sample code in the help. Create a Virtual folder before using the project.

Let me know the mistake in the code.

Regards,
Kaja

************************************************
To create a "live" chart, step through the following:

Create a new ASP.NET application.
Right Click on the project's References and add in a reference to the TeeChart Pro ActiveX Control v7 (COM Tab).
Open the WebForm in HTML view and make sure the BODY of the page looks like this:
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
</form>
<OBJECT id="TChart1" style="Z-INDEX: 101; LEFT: 34px; WIDTH: 482px; POSITION: absolute; TOP: 38px; HEIGHT: 358px"
classid="clsid:FAB9B41C-87D6-474D-AB7E-F07D78F2422E" VIEWASTEXT>
<PARAM NAME="Base64" VALUE="VFBGMAtUQ2hhcnRDaGFydAAETGVmdAIAA1RvcAIABVdpZHRoA+IBBkhlaWdodANmARJUaXRsZS5U
ZXh0LlN0cmluZ3MBBghUZWVDaGFydAAAAAAAAAACAAAAAP////8=">
</OBJECT>
<script language="vbscript">
Sub Window_Onload()
TChart1.Import.LoadFromURL("http://localhost/CsharpWeb/WebForm2.aspx")
End Sub

Sub TChart1_OnAfterDraw()

End Sub
</script>
</body>

Add in a new WebForm to your project and name it "WebForm2".
In the Page_Load event of WebForm2, add in the following code (C# example) and include the private field indicated:
private TeeChart.TChartClass tChart1 = new TeeChart.TChartClass();
private void Page_Load(object sender, System.EventArgs e) {
tChart1.AddSeries(TeeChart.ESeriesClass.scBar);
tChart1.Series(0).FillSampleValues(20);
object stream = tChart1.Export.asNative.SaveToStream(true);
Response.BinaryWrite((byte[])stream);
}

************************************************

Posted: Tue Mar 13, 2007 12:39 pm
by 9527390
Any update?

Can you send a working sample code demonstrating how to use TChart ActiveX control in ASP.NET using C#

Posted: Fri Mar 16, 2007 3:52 pm
by narcis
Hi HW,

You could try using the examples provided at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Studio .NET (Default English installation path).

Posted: Tue Mar 20, 2007 4:47 am
by 9527390
Thanks. I was using the sample earlier. I don't know what mistake I made last time.

It worked now.