Exporting all series to xls

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
susi
Newbie
Newbie
Posts: 10
Joined: Wed Jul 28, 2004 4:00 am

Exporting all series to xls

Post by susi » Mon Jan 25, 2010 9:50 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exporting all series to xls

Post by Yeray » Mon Jan 25, 2010 3:27 pm

Hi Susi,

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,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

susi
Newbie
Newbie
Posts: 10
Joined: Wed Jul 28, 2004 4:00 am

Re: Exporting all series to xls

Post by susi » Tue Jan 26, 2010 10:35 am

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.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exporting all series to xls

Post by Yeray » Tue Jan 26, 2010 11:46 am

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?

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,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

susi
Newbie
Newbie
Posts: 10
Joined: Wed Jul 28, 2004 4:00 am

Re: Exporting all series to xls

Post by susi » Tue Jan 26, 2010 4:37 pm

It works for all formats but XLS.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exporting all series to xls

Post by Yeray » Wed Jan 27, 2010 8:48 am

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:

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);
   }
}
So I recommend you to try the TeeChart v8 eval version (or the v9 beta released yesterday)
http://www.steema.com/evaluation/vcl
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply