Page 1 of 1

Export AND Import XML?

Posted: Thu Jun 26, 2008 11:19 am
by 10545590
Hi !

You can use SaveToFile and LodFromFile to export / import TEE files. But is there a possibility to import / export XML?

And second question ... Can I use a String which includes the XML stuff and TChart generates the Chart from that?

Posted: Fri Jun 27, 2008 10:21 am
by narcis
Hi moelski,
You can use SaveToFile and LodFromFile to export / import TEE files. But is there a possibility to import / export XML?
You can export a chart to XML using SaveChartToXMLStream or SaveChartToXMLFile, for example:

uses TeeStore;

procedure TForm1.FormCreate(Sender: TObject);
var stream: TMemoryStream;
begin
stream:=TMemoryStream.Create;

try
SaveChartToXMLStream(TCustomChart(Chart1),stream,true,true);
finally
stream.Free;
end
end;

You can also export chart's data to an XML fiile as shown in the features demo and tutorials.
And second question ... Can I use a String which includes the XML stuff and TChart generates the Chart from that?
You can not import full chart settings from XML except you do it manually. However, you can import chart's series and data from an XML file as shown in the All Features\Welcome!\Components\XML Import source example at the new features demo.