TeePreviewer InvalidCastExpectation

TeeChart for ActiveX, COM and ASP
Post Reply
TomK
Newbie
Newbie
Posts: 3
Joined: Mon Nov 08, 2010 12:00 am

TeePreviewer InvalidCastExpectation

Post by TomK » Fri Mar 25, 2011 12:58 am

Why am I geting this error when running this code (Using Pro ActiveX 2010.0.0.3 )

Error : "Unable to cast object of type 'AxTeeChart.AxTChart' to type 'TeeChart.TChart'."

With TeePreviewer1
.Chart = TChart1
.PreviewTitle = "My Custom Title"
.ShowPreview()
End With


Regards
Tom

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeePreviewer InvalidCastExpectation

Post by Sandra » Fri Mar 25, 2011 2:29 pm

Hello Tom,

I couldn't reproduce your problem here with last version of TeeChartActivex. Can you please, send us a simple project because we can reproduce exactly your here?

Thanks,
Best Regards,
Sandra Pazos / 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

TomK
Newbie
Newbie
Posts: 3
Joined: Mon Nov 08, 2010 12:00 am

Re: TeePreviewer InvalidCastExpectation

Post by TomK » Fri Mar 25, 2011 11:54 pm

Hi,

Attached is a small project file as requested. I look forward to your resolution asap, this issue is very frustrating to say the least.

OS: Windows 7 Professional
Processor: Intel Core(TM)2 Quad CPU Q8200 @2.33GHz
Visual Studio 2010 Sp1 (VB.NET)
Installed TeeCharts:
TeeChart Version 7.0.1.4
TeeChart Version 8.0.0.5
TeeChart Pro v2010.0.0.3.11109 Win32

Regards,

Tom
Attachments
WindowsTestApplication.zip
Test Project file
(279.72 KiB) Downloaded 512 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeePreviewer InvalidCastExpectation

Post by Sandra » Mon Mar 28, 2011 2:39 pm

Hello Tom,

Thanks for your project. I could reproduce your problem and I found that Previewer and Chart aren't linked correctly:

Code: Select all

 With AxTeePreviewer1
            .Chart = AxTChart1
            .........
To link the Previewer with chart you need use ChartLink so do in next lines of code:

Code: Select all

 With AxTeePreviewer1
            .ChartLink = AxTChart1.ChartLink
            .......
Could you modify your code and check if it solve your problem?

I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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

TomK
Newbie
Newbie
Posts: 3
Joined: Mon Nov 08, 2010 12:00 am

Re: TeePreviewer InvalidCastExpectation

Post by TomK » Mon Mar 28, 2011 11:45 pm

Hi Sandra,

Thank you for your quick response, the code now works.
By the way, the code I sent you was from your forum site.

Thanks again

Tom

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeePreviewer InvalidCastExpectation

Post by Sandra » Tue Mar 29, 2011 9:35 am

Hello Tom,

I am glad that your problem is solved. About of initially code you were using, I inform you that it is made in Visual Basic 6.0 so it doesn't work if you use Visual Studio where you need use ChartLink.

Thanks,
Best Regards,
Sandra Pazos / 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

Post Reply