I'm using TChart2015.ocx with C++ interface.
I want to export only a few of the line series on my chart to excel, not all of them. Is that possible? Also, I want to have just 1 column for X and multiple columns for my Y values. Is there an example that I can see to do this?
Regards
nbp.
Exporting selected series to Excel
Re: Exporting selected series to Excel
Hello,
There was a VCL ticket reporting the xls generated from TeeChart couldn't be open with Excel >= 2013 (note TeeChart ActiveX is a wrapper from TeeChart VCL).
http://bugs.teechart.net/show_bug.cgi?id=1257
We fixed it for the TeeChart VCL v2016.19 recently published, adding the option to export to .xlsx. In Delphi:
For Excel < 2013 (and current LibreOffice, OpenOffice,...), the .xls still works fine in both TeeChart ActiveX and VCL/FMX.
Also note we expect to improve the new .xlsx option in a future:
http://bugs.teechart.net/show_bug.cgi?id=1669
This would allow you to call the export as many times as series you'd like to export, and all the data would be in the same .xlsx.
There was a VCL ticket reporting the xls generated from TeeChart couldn't be open with Excel >= 2013 (note TeeChart ActiveX is a wrapper from TeeChart VCL).
http://bugs.teechart.net/show_bug.cgi?id=1257
We fixed it for the TeeChart VCL v2016.19 recently published, adding the option to export to .xlsx. In Delphi:
Code: Select all
with TSeriesDataXLSObject.Create(Chart1,nil) do
try
//IncludeIndex:=true;
//IncludeHeader:=true;
//IncludeColors:=true;
//IncludeLabels:=true;
SaveToFile('C:\tmp\exported.xlsx');
finally
Free;
end;
Also note we expect to improve the new .xlsx option in a future:
http://bugs.teechart.net/show_bug.cgi?id=1669
This would allow you to call the export as many times as series you'd like to export, and all the data would be in the same .xlsx.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting selected series to Excel
I have several series on a chart. They all share the same X values, only differ in their Y values. Can I export them to Excel so that I only have a single column for the X values and multiple columns for the Y values? I'm using TChart ActiveX 2015 ocx component.
Re: Exporting selected series to Excel
Hello,
You can't choose which series to export. Instead, you could save your chart to a stream, remove the series you don't want in the xls, export the chart to an xls and reload the stream into your chart. Ie:
You can't choose which series to export. Instead, you could save your chart to a stream, remove the series you don't want in the xls, export the chart to an xls and reload the stream into your chart. Ie:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
For i = 0 To 4
TChart1.AddSeries scBar
TChart1.Series(i).FillSampleValues
Next i
End Sub
Private Sub Command1_Click()
Dim MyStream As Variant
MyStream = TChart1.Export.asNative.SaveToStream(True)
TChart1.RemoveSeries 2
TChart1.RemoveSeries 1
TChart1.Export.asXLS.IncludeHeader = True
TChart1.Export.asXLS.IncludeIndex = True
TChart1.Export.asXLS.SaveToFile "mytest.xls"
TChart1.ClearChart
TChart1.Import.LoadFromStream MyStream
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting selected series to Excel
Has the above bug been fixed? The link above says it has been fixed on 10-28? If so, what release contains the fix?
Re: Exporting selected series to Excel
Hello,
I see the ticket #1257 was closed the 28th October 2016, but it was reopened the 7th December 2016. I'm reviewing what happened.
And the ticket #1669 hasn't been closed.
I see the ticket #1257 was closed the 28th October 2016, but it was reopened the 7th December 2016. I'm reviewing what happened.
And the ticket #1669 hasn't been closed.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting selected series to Excel
Hello,
Since the upcoming v2017.20 will include both changes, we are closing the ticket.
The new feature allowing to export to xlsx was introduced in v2016.19. However, this option was refined adding support straight from the editor after v2016.19.That's why it was reopened.Yeray wrote:I see the ticket #1257 was closed the 28th October 2016, but it was reopened the 7th December 2016. I'm reviewing what happened.
Since the upcoming v2017.20 will include both changes, we are closing the ticket.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Exporting selected series to Excel
Thanks for the reply.
So I just want to confirm that the 2017.20 build will include the feature to export only selected series to Excel?
So I just want to confirm that the 2017.20 build will include the feature to export only selected series to Excel?
Re: Exporting selected series to Excel
Hello,
You can already export a subset of series to .xls using the solution suggested above in current TeeChart ActiveX versions.
The only problem with that option is that the .xls won't open in Excel >= 2013 (you can open it in LibreOffice/OpenOffice instead).
With the current TeeChart VCL v2016.19 you are able to do the same with .xlsx and it will open in Excel >= 2013.
However, this runtime option still has to be ported to TeeChart ActiveX: #1670.
Will it fit your needs?
Finally, worth to mention here, with the coming TeeChart VCL v2017.20, and with the recently published TeeChart ActiveX v2017.0.0.0, the export to .xlsx is available through the editor:
We are mixing TeeChart VCL and ActiveX here. Let me try to clarify:nbp wrote:So I just want to confirm that the 2017.20 build will include the feature to export only selected series to Excel?
You can already export a subset of series to .xls using the solution suggested above in current TeeChart ActiveX versions.
The only problem with that option is that the .xls won't open in Excel >= 2013 (you can open it in LibreOffice/OpenOffice instead).
With the current TeeChart VCL v2016.19 you are able to do the same with .xlsx and it will open in Excel >= 2013.
However, this runtime option still has to be ported to TeeChart ActiveX: #1670.
Will it fit your needs?
Finally, worth to mention here, with the coming TeeChart VCL v2017.20, and with the recently published TeeChart ActiveX v2017.0.0.0, the export to .xlsx is available through the editor:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |