Page 1 of 1

Cannot load TeeChart v2 .ten file in TeeChart v2009

Posted: Tue Jan 05, 2010 11:39 am
by 15654551
We have a .NET 1.1 C#.NET application which uses TeeChart v2 and makes extensive use of templates stored in files.

We're attempting to upgrade this application to TeeChart 2009 but cannot get the old templates to load in the newer version of TeeChart. Before buying the new licenses we were lead to believe the versions would be backwards compatible - is this the case?

To replicate this behaviour in the simplest way, we used the Export > Native > Save... feature of the TeeChart v2 editor to save a chart definition to a .ten file. We then attempted to load this in very simple test project with a TeeChart 2009 control on a WinForm, using the dialog called via tChart1.Import.ShowImportDialog()

The exception we see upon attempting to import the file is "An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll".

Is there any way of getting the old TeeChart files to load into TeeChart 2009 or must we recreate all of our charts (this would be a huge task)??

Another thread on these forums (link) suggests "using LoadChartFromStreamCheck setting TryReadData to true" which a user had some success with, however I believe this may only work for VCL/CLX and not .NET?

Thanks for your help

Re: Cannot load TeeChart v2 .ten file in TeeChart v2009

Posted: Tue Jan 05, 2010 4:05 pm
by yeray
Hi Reefy,
Reefy wrote:We're attempting to upgrade this application to TeeChart 2009 but cannot get the old templates to load in the newer version of TeeChart. Before buying the new licenses we were lead to believe the versions would be backwards compatible - is this the case?
We pay special attention on keeping backwards compatibility, yes. But it's still possible that, trying to fix a problem or implementing a new feature, we could break some of this compatibility.
Reefy wrote:To replicate this behaviour in the simplest way, we used the Export > Native > Save... feature of the TeeChart v2 editor to save a chart definition to a .ten file. We then attempted to load this in very simple test project with a TeeChart 2009 control on a WinForm, using the dialog called via tChart1.Import.ShowImportDialog()
I'm creating a chart with the simple following code with TeeChart v2 and saving it to a ten file as you say.

Code: Select all

tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.FillSampleValues();
Then I open another project with TeeChart v2009 and I can load the chart without problems with the call:

Code: Select all

tChart1.Import.ShowImportDialog();
I think that the problem could be caused by an specific property that should have been changed with the time. Could you please send us a "ten" conflictive file?

Thanks in advance.

Re: Cannot load TeeChart v2 .ten file in TeeChart v2009

Posted: Tue Jan 05, 2010 5:16 pm
by 15654551
Hi Yeray

Thanks for your prompt response. I've since tried loading your own 'demo.ten' from the http://www.teechart.net website and that also fails, so I'm wondering whether this is a more serious issue with your latest release. Also tried on another machine.

Can you try it also? The url is the default value in the 'From URL' box of the 'TeeChart Import' dialog box (http://www.teechart.net/demo.ten).

My test application is just a .NET 1.1 C# WinForm with a TeeChart 2009 control (release as of 4th Dec 2009) dropped on it and the single line of code in the Form1_Load:

Code: Select all

this.tChart1.Import.ShowImportDialog();
The exception thrown when the 'From URL' radio button is select and 'Import' is clicked is:

Code: Select all

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Object must implement IConvertible.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Steema.TeeChart.Import.Imports.DeserializeFrom(SerializationInfo info, StreamingContext context)
   at Steema.TeeChart.Chart..ctor(SerializationInfo info, StreamingContext context)
   --- End of inner exception stack trace ---
   at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
   at System.Runtime.Serialization.ObjectManager.DoFixups()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at Steema.TeeChart.Import.TemplateImport.Load(Stream stream)
   at Steema.TeeChart.Import.TemplateImport.FromURL(String url)
   at Steema.TeeChart.Editors.ImportEditor.button1_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I just attempted to upload a simple test .ten file to your forum and it failed saying "The extension ten is not allowed." - please let me know if there is an email address I can send the .ten file to or some other means of getting it to you.

Thanks

Re: Cannot load TeeChart v2 .ten file in TeeChart v2009

Posted: Thu Jan 07, 2010 2:53 pm
by narcis
Hi Reefy,
Thanks for your prompt response. I've since tried loading your own 'demo.ten' from the http://www.teechart.net website and that also fails, so I'm wondering whether this is a more serious issue with your latest release. Also tried on another machine.

Can you try it also? The url is the default value in the 'From URL' box of the 'TeeChart Import' dialog box (http://www.teechart.net/demo.ten).
Yes, I could reproduce this one too and added it to the defect list (TF02014625) to be fixed for next releases.
I just attempted to upload a simple test .ten file to your forum and it failed saying "The extension ten is not allowed." - please let me know if there is an email address I can send the .ten file to or some other means of getting it to you.
You can either compress it in a *.zip (or *.rar, *.7z, ...) package and attach it to the forums or post it at http://www.steema.net/upload.

Thanks in advance.