Typeconverter error when exporting to memory stream

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Typeconverter error when exporting to memory stream

Post by Lars Iversen » Fri Aug 03, 2007 8:34 am

Hi
I'm using teechart version: 2.0.2306.26232

When trying to save the teechart to memory stream:
Dim ms As New MemoryStream
uxChart.Export.Template.Save(ms)

I get the following error:
TypeConverter cannot convert from System.String.

Can you tell why this happens and what to do to avoid it?

Thanks
Lars iversen

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Fri Aug 03, 2007 8:51 am

Hi Lars

Could you please try with the last version 2 (Build 2.0.2652.22325 "available at the web") ? If the problem persist could you please send us a simple example project we can run "as-is" to reproduce the issue here?

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

Please let us know when you have posted the sample project.

Thanks in advance
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Fri Aug 03, 2007 9:53 am

After having installed that version my app is acting strange.
I get an error on all lines where I use doevents:
System.Windows.Forms.Application.DoEvents()

The error is: Parameter is not valid.

When my form then appears it shows the teechart as one big red cross.

Have you seen that problem before?

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

Post by Narcís » Fri Aug 03, 2007 11:54 am

Hi Lars,

Not that I have heard of.
When my form then appears it shows the teechart as one big red cross.
Is it an ASP.NET application?

Could you please send us a simple example project as Edu asked?

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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Fri Aug 03, 2007 12:03 pm

It's a VB NET 2005 app.
It's not simple for me to create a stand-alone app that recreates the problem because it is part of a huge app, with alot of classes handling different parts, but I'll try.

BR
Lars

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Fri Aug 03, 2007 12:57 pm

Hmm a reboot of my computer helped on the red cross. That does not happen anymore.

But still with the latest version of teechart V2 I get the typeconverterter error:

When trying to save the teechart to memory stream:
Dim ms As New MemoryStream
uxChart.Export.Template.Save(ms) 'uxChart is a tchart object placed on the windows form

Error is: TypeConverter cannot convert from System.String.

I have tried to create a small stand-alone example but I can't reproduce the problem. So It must have something to do with the settings altered on the tchart e.g. axis names, titles, scaling, whatever. Or because of the data.

Do you have any ideas about what I should pursue to recreate the error?

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

Post by Narcís » Fri Aug 03, 2007 2:55 pm

Hi Lars,
I have tried to create a small stand-alone example but I can't reproduce the problem. So It must have something to do with the settings altered on the tchart e.g. axis names, titles, scaling, whatever. Or because of the data.

Do you have any ideas about what I should pursue to recreate the error?
In that case it will be very difficult for us guessing which the problem is. It would be really helpful if you could arrange a simple example project we can run "as-is" to reproduce the problem here. If that's not possible, it may also help if you export your chart to a .ten file and send it to us.

You'll find more information about exporting TeeChart at the tutorials available at TeeChart's program group.

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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Mon Aug 06, 2007 12:29 pm

Hmm I can't create a demo project because my project is too complex.

I have now tried:
tchart1..Export.Template.Save("C:\TeeChart.ten")

And it gives me the same error:
NotSupportedException ocurred
TypeConverter cannot convert from System.String.

So I also can't create a .TEN file for you.

Any suggestions?

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 Aug 06, 2007 12:48 pm

Hi Lars,

Ok, now I see the problem may be in the file path string. You could try using this:

Code: Select all

tchart1..Export.Template.Save(@"C:\TeeChart.ten") 
or this:

Code: Select all

tchart1..Export.Template.Save("C:\\TeeChart.ten") 
Please let us know how it goes at your end.

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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Mon Aug 06, 2007 12:51 pm

Do you realize that I use VB and not C#.?
None of your two suggestions are valid in VB net 2005

BR Lars

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 Aug 06, 2007 2:41 pm

Hi Lars,

Sorry for not noticing about VB.NET code. I'd would really help if you could arrange a simple project with a chart set up as the one in the big project and populate this chart with random data.

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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Post by Lars Iversen » Tue Aug 07, 2007 7:53 am

Hi

Now I went back to the old version of teechart (2.0.2306.26232)
Now I don't get the error of Parameter is not valid. when doing a:
System.Windows.Forms.Application.DoEvents()


So for me the new version is not usable at all.
Sometimes the old version gives this error:
TypeConverter cannot convert from System.String.
when saving template to memorystream. I can't figure out what triggers it. Sometimes it works fine. It seems though that if the error with TypeConverter happens it will continue to happen at each template export until the pc is rebooted.

I'm quite puzzled by this.

BR
Lars Iversen

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

Post by Narcís » Tue Aug 07, 2007 11:09 am

Hi Lars,

Now we know you are using DoEvents in your project. We tried making that call before exporting the chart into a stream but this didn't produce any error. Any information you feel to be important to reproduce the problem here will be appreciated.

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

Post Reply