Page 1 of 1

Typeconverter error when exporting to memory stream

Posted: Fri Aug 03, 2007 8:34 am
by 9637396
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

Posted: Fri Aug 03, 2007 8:51 am
by 9348258
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

Posted: Fri Aug 03, 2007 9:53 am
by 9637396
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?

Posted: Fri Aug 03, 2007 11:54 am
by narcis
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!

Posted: Fri Aug 03, 2007 12:03 pm
by 9637396
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

Posted: Fri Aug 03, 2007 12:57 pm
by 9637396
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?

Posted: Fri Aug 03, 2007 2:55 pm
by narcis
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!

Posted: Mon Aug 06, 2007 12:29 pm
by 9637396
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?

Posted: Mon Aug 06, 2007 12:48 pm
by narcis
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.

Posted: Mon Aug 06, 2007 12:51 pm
by 9637396
Do you realize that I use VB and not C#.?
None of your two suggestions are valid in VB net 2005

BR Lars

Posted: Mon Aug 06, 2007 2:41 pm
by narcis
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.

Posted: Tue Aug 07, 2007 7:53 am
by 9637396
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

Posted: Tue Aug 07, 2007 11:09 am
by narcis
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.