Page 1 of 1

tchart import : Wrong *.tee file format

Posted: Fri Jan 12, 2018 9:22 am
by 16682352
Hello,

I want to export tchart config and then import config stream :

Code: Select all

	CExport export1 = (CExport)m_tchart.get_Export();
	VARIANT var = export1.SaveToXMLStream(TRUE, TRUE);

	CImport import1 = (CImport)m_tchart.get_Import();
	import1.LoadFromStream(var);
it shows error message: "Wrong *.tee file format"
can you show where the problem is?
or would tell me how to do?

TChart version: 2017 ActiveX

Thanks

Re: tchart import : Wrong *.tee file format

Posted: Fri Jan 12, 2018 3:34 pm
by yeray
Hello,

You are saving using XML and importing using Native tee format. Try using AsNative.SaveToStream to export your chart. Ie this works fine for me in VB6:

Code: Select all

  TChart1.Aspect.View3D = False
  TChart1.AddSeries scPie
  TChart1.Series(0).FillSampleValues 5
    
  TChart2.Import.LoadFromStream TChart1.Export.asNative.SaveToStream(True)

Re: tchart import : Wrong *.tee file format

Posted: Mon Jan 15, 2018 2:36 am
by 16682352
Thanks for your answer. I have another question:
I saved the TChart(looks like attached file : origin.png) as *.tee file,
but when i open the saved file(*.tee file), it becomes this: saved.png, the background is changed.
can you help me to fix it?

Re: tchart import : Wrong *.tee file format

Posted: Mon Jan 15, 2018 8:54 am
by yeray
Hello,

I've reproduced this problem so I've added it tot he public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1966

Thanks for reporting it.