Page 1 of 1

saving and loading of entire chart

Posted: Tue Sep 14, 2010 12:46 pm
by 10048147
Is it possible to save and load, not only the chart 'template', but all information regarding the configuration of a chart? This would include what 'kind' of datasource (single record, dataset, summary, crosstab, etc.) and the name of the dataset (query1 or table1) along with the source of the apprpropriate values.

I have an application in which I wish to be able to save a configured chart, which may be, say a crosstab with data from a query, to a database. I then want the user to be able to load the chart from the database fully configured. I have tried to do this with save/loadchartfromfile, save/loadchartfrom stream, etc., but when the chart is reloaded, the user still has to configure the datasource source, whether it is a crosstab, summary, etc and the source fields for xvalues, yvalues, etc.

Thanks,

Dennis

Re: saving and loading of entire chart

Posted: Wed Sep 15, 2010 2:24 pm
by yeray
Hi Den,

The possibility to save also the connection info in the tee file when you export your chart is a feature already in the wish list to be implemented in future releases (TV52014739).
I've incremented it's priority.

Re: saving and loading of entire chart

Posted: Wed Sep 15, 2010 6:01 pm
by 10048147
Thanks, Yeray.

I would imagine in order to do this now, one would have to:

- store the tee template
- iterate through the form components to see if a dbcrosstab component existed, was assigned a series and was active --> therefore a crosstab type chart
- determine if the xvalues had "#" in them --> therefore a summary type chart
- otherwise it is most likely a simple dataset chart
- store the above, along with the connection info (including the dataset info - query sql)
- based on the stored values above, set the necessary 'properties' of the chart upon loading

To your knowledge, has this been done by anyone before, or have any hints as to how to do it now. It would be a lot easier if there were some property of the chart which would tell you what 'kind' it was, as the datasource tab of the editor does when selecting 'manual', 'random', 'single record', 'dataset', etc.

Thanks,

Dennis

Re: saving and loading of entire chart

Posted: Thu Sep 16, 2010 2:22 pm
by narcis
Hi Dennis,

I'm not aware of anyone having done before. The only solution I can think of for now is manually assigning datasources after loading a template chart. One of the problems with this feature is that TeeChart native template files may be loaded in machines different to the one which generated them and required datasources may not exist there. However, you can already choose whether you want to include series data when exporting a chart. There are programmatic datasource setting examples in the database related tutorial. Tutorials can be found at TeeChart's program group.