Hi,
I need to be able to programmatically pick-up the name of the .ten format file created through the Native/Save tab/button in the Chart Editor. That is, I want to use the Native/Save existing feature but to be able in my code (where I create and launch the Editor instance) to handle the saved file name.
Also, in case the user forgets to save his work in Editor, I want to be able to propose to save it during the "CloseForm" button event. I've tested the access to this event, that works, but what is the method to execute for saving in native (.ten) format programmatically?
Thanks!
Chart Edit Native/Save event
Re: Chart Edit Native/Save event
Hello Gabriel,
Also, I recommend that use SaveFileDialog for save file name. You could use a similar code as next:
I hope will helps.
Thanks,
I am sorry, but actually is not possible pick-up the name of files using Chart Editor with last version of TeeChart.Net. I have added your suggestion in wish-list with number [TF02014701] to be considered for inclusion in future releases.I need to be able to programmatically pick-up the name of the .ten format file created through the Native/Save tab/button in the Chart Editor. That is, I want to use the Native/Save existing feature but to be able in my code (where I create and launch the Editor instance) to handle the saved file name.
Also, I recommend that use SaveFileDialog for save file name. You could use a similar code as next:
Code: Select all
string nameChart;
private void InitializeChart()
{
Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar.FillSampleValues();
}
private void button1_Click(object sender, EventArgs e)
{
saveFileDialog1.Filter = "TenFile (.ten)|*.ten";
saveFileDialog1.ShowDialog();
if (saveFileDialog1.FileName != "")
{
tChart1.Export.Template.IncludeData = true;
tChart1.Export.Template.Save(saveFileDialog1.FileName);
nameChart = saveFileDialog1.FileName;
}
}
Please, see TeeChart .Net Pro Tutorials Tutorial12 - Exporting and Importing Charts concretely TeeChart's 'Ten' template and data export/import format .Also, in case the user forgets to save his work in Editor, I want to be able to propose to save it during the "CloseForm" button event. I've tested the access to this event, that works, but what is the method to execute for saving in native (.ten) format programmatically?
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart Edit Native/Save event
Thanks Sandra.
As I said in my initial post, the way around is that I've coded a mandatory SaveFileDialog in the Close_Editor event. But I thought it would be good that you guys take into account of exposing an event for that button that you already have.
Also, I've spotted that if I try to export the created chart in .ten format (it is proposed on the list), but with an image-type file format highlighted (thus selected) on the textbox, I get a .net error window. This is normal, but:
- think about removing from the SaveFileDialog filter the .ten type in this case.
- better, implement in your code a try/catch rather than leaving the .net exception window to pop-up.
As I said in my initial post, the way around is that I've coded a mandatory SaveFileDialog in the Close_Editor event. But I thought it would be good that you guys take into account of exposing an event for that button that you already have.
Also, I've spotted that if I try to export the created chart in .ten format (it is proposed on the list), but with an image-type file format highlighted (thus selected) on the textbox, I get a .net error window. This is normal, but:
- think about removing from the SaveFileDialog filter the .ten type in this case.
- better, implement in your code a try/catch rather than leaving the .net exception window to pop-up.
Re: Chart Edit Native/Save event
Hi Gabriel,
I've added it to the wish list to be enhanced for future releases (TF02014714).Gabriel wrote:Also, I've spotted that if I try to export the created chart in .ten format (it is proposed on the list), but with an image-type file format highlighted (thus selected) on the textbox, I get a .net error window. This is normal, but:
- think about removing from the SaveFileDialog filter the .ten type in this case.
- better, implement in your code a try/catch rather than leaving the .net exception window to pop-up.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |