Hi!
I want to export the data in a chart to excel. I use this code:
with TSeriesDataXLS.Create(chart1,nil) do
try
includeindex:=true;
IncludeHeader := True;
IncludeLabels := True;
CopyToClipboard;
finally
Free;
end;
but it doesn't work. When I paste in Excel I get empty cells. The number of empty cells differs so it does something. If my piechart for instance has 4 pieces I get 4 empty cells and so on.
If I change "CopyToClipboard;" to "SaveToFile('c:\test.xls');" it works but
I would like to avoid the actual excel-file. The users of my application have to be able to copy the chart-data into an existing excel document.
What do I do wrong?
/Patrik
exporting to excel
Hi Patrik,
to do a copy/paste of the data to Excel file you must export the data as text to a ClipBoard and then you will be able to paste it on excel sheet.
to do a copy/paste of the data to Excel file you must export the data as text to a ClipBoard and then you will be able to paste it on excel sheet.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Patrik,
you can use the following code :
you can use the following code :
Code: Select all
with TSeriesDataText.Create(Chart1,nil) do
try
TextDelimiter:=',' ; { try also: TeeTabDelimiter }
IncludeIndex:=true;
CopyToClipBoard;
finally
Free;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com