Hi,
I'm using TeeChart V. 7.07 with BCB 6 and I want to export all series of a chart into an XLS file at runtime. How can I do that without executing the ChartEditor? (I'm unable to run the ChartEditor at runtime due to some really strange linker errors ("Unable to open file 'PENDLG.DFM'"); I'm pretty sure they just appear because I'm very moronic.)
Regards,
Susi
Exporting all series to xls
Re: Exporting all series to xls
Hi Susi,
The following seems to work fine here in C++Builder 2010 and TeeChart Pro v8. Could you please try it?
The following seems to work fine here in C++Builder 2010 and TeeChart Pro v8. Could you please try it?
Code: Select all
#include "TeeStore.hpp"
#include "TeExport.hpp"
//...
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSeriesDataXML *tmpXML = new TSeriesDataXML(Chart1, NULL);
tmpXML->IncludeIndex=true;
tmpXML->SaveToFile("C:\\tmp\\test.xml");
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting all series to xls
Hi,
it worked like a charm. But for some reason, I can't manage to export the labels of the series into an xls file; you know, the labels from the legend. It's simply "Index", "X", "Y", "X", "Y" in the first row. IncludeLabels does nothing.
Regards,
S.
it worked like a charm. But for some reason, I can't manage to export the labels of the series into an xls file; you know, the labels from the legend. It's simply "Index", "X", "Y", "X", "Y" in the first row. IncludeLabels does nothing.
Regards,
S.
Re: Exporting all series to xls
Hi Susi,
The following code seems to export the labels fine for me here with TeeChart VCL 8.06. Isn't it working with the latest TeeChart VCL 7?
The following code seems to export the labels fine for me here with TeeChart VCL 8.06. Isn't it working with the latest TeeChart VCL 7?
Code: Select all
#include "Series.hpp"
#include "TeeStore.hpp"
#include "TeeExport.hpp"
//...
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TBarSeries *bar1 = new TBarSeries(this);
Chart1->AddSeries(bar1);
for (int i = 0; i < 6; i++) {
bar1->AddBar(random(100),"label nº" + IntToStr(i+1), clTeeColor);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSeriesDataXML *tmpXML = new TSeriesDataXML(Chart1, NULL);
tmpXML->IncludeIndex=true;
tmpXML->IncludeLabels=true;
tmpXML->SaveToFile("C:\\tmp\\test.xml");
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting all series to xls
It works for all formats but XLS.
Re: Exporting all series to xls
Hi Susi,
Excuse me, I was reading XML where XLS was written. But I still have correct results here with v8.06 with the following code:
So I recommend you to try the TeeChart v8 eval version (or the v9 beta released yesterday)
http://www.steema.com/evaluation/vcl
Excuse me, I was reading XML where XLS was written. But I still have correct results here with v8.06 with the following code:
Code: Select all
#include "TeeStore.hpp"
#include "Series.hpp"
//...
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSeriesDataXLS *tmpXLS = new TSeriesDataXLS(Chart1, NULL);
tmpXLS->IncludeIndex=true;
tmpXLS->IncludeLabels=true;
tmpXLS->SaveToFile("C:\\tmp\\test.xls");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TBarSeries *bar1 = new TBarSeries(this);
Chart1->AddSeries(bar1);
for (int i = 0; i < 6; i++) {
bar1->AddBar(random(100),"label nº" + IntToStr(i+1), clTeeColor);
}
}
http://www.steema.com/evaluation/vcl
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |