Questions about exporting TDBChart to Excel
Posted: Thu Jun 30, 2016 12:55 pm
When I export data of my application from TDbChart componenet to Excel, export appears like:
I need:
Replace the text in the first column "Text" for "Value"
Hide / Remove the "X" column
How can I do it?
PD:
Version TeeChar Pro v2015.26.150901 32 bit VCL
Attached example of my code
I need:
Replace the text in the first column "Text" for "Value"
Hide / Remove the "X" column
How can I do it?
PD:
Version TeeChar Pro v2015.26.150901 32 bit VCL
Attached example of my code
Code: Select all
procedure TFGestionCurvasCalculadas.actExportExecute(Sender: TObject);
var tmpChart: TChart;
i : Integer;
begin
tmpChart := TChart.Create(Self);
try
for i := 0 to dbcCurves.SeriesCount - 1 do
begin
if dbcCurves[i].Active then
begin
CloneChartSeries(dbcCurves.Series[i]).ParentChart := tmpChart;
tmpChart.SeriesList[i].XValues.DateTime := True;
tmpChart.SeriesList[i].YValues.Name := 'Curve';
end;
end;
with TSeriesDataXLS.Create(tmpChart, nil) do
try
UseSeriesFormat := True;
IncludeHeader := True;
SaveToFile('C:\TEMP\example.xls');
finally
Free;
end;
finally
tmpChart.Free;
end;
end;