Page 1 of 1

Exception with loading template files

Posted: Fri Mar 16, 2007 2:55 pm
by 8125470
Version
1.1.2531.28391

Steps to create exception: -
1/ Create a chart.
2/ Add a Bar Series.
3/ Add random data.
4/ Add a "Mark Tips" Tool from the TeeChart Editor Tools Section.
5/ Verify the tooltips are showing.
6/ Open TeeChart Editor, select the added Mark Tips tool and uncheck the Active checkbox and press Close.
7/ Now execute the following: -

this.tChart1.Export.Template.Save("test.ten");
this.tChart1.Import.Template.Load("test.ten");

You will find that when Loading the template file, you will get an exception.
System Exception : - "Exception has been thrown by the target of an invocation."
Inner Exception : -"Object Reference not set to an instance of an object"

Please bear in mind, that I can follow the same process above and use the "Draw Line" tool and it works fine.

Therefore I conclude, that when using the "Mark Tips" tool, the template file is incorrect after making the tool inactive.

Posted: Fri Mar 16, 2007 3:37 pm
by narcis
Hi VH1,

I could reproduce the issue here using TeeChart for .NET v1 and also checked that this works fine using TeeChart for .NET v2. A workaround for v1 would be enabling the tool before exporting and disabling it after exporting, for example:

Code: Select all

		private System.IO.MemoryStream stream;

		private void button1_Click(object sender, System.EventArgs e)
		{
			stream = new System.IO.MemoryStream();
			
			markTips1.Active = true;
			tChart1.Export.Template.Save(stream);
			markTips1.Active = false;
		}

Posted: Fri Mar 16, 2007 3:58 pm
by 8125470
Will there be an issue number raised for this so that I can track it please?

Posted: Fri Mar 16, 2007 4:07 pm
by narcis
Hi VH1,

The issue has been logged (TF02012132) to be considered if a new v1 release is made at any stage and this issue can be easily fixed.