Series Export as Excel

TeeChart for ActiveX, COM and ASP
Post Reply
Activex7
Newbie
Newbie
Posts: 16
Joined: Wed Aug 16, 2006 12:00 am

Series Export as Excel

Post by Activex7 » Wed Dec 07, 2011 10:47 pm

Hi,

We are using the latest version of Teechart, the 2011 version. When trying to export all the series data to a Excel document, I see that the series names are not exported. Just a generic X and Y are exported instead in the header.

Whereas If I do a same export to a text format then I get the series names. Is there any way I can get the series names in the Excel export as part of the header ?

Also is there any way I can interact or format the output to Excel ? Right now it seems pretty straightforward with no scope for much customization. I wanted to avoid going the Automation route for Excel, please let me know if any of this is possible.

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Series Export as Excel

Post by Sandra » Fri Dec 09, 2011 12:27 pm

Hello Activex7,

I suggest you do something as next link, where is changed XValues and YValues, names.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Activex7
Newbie
Newbie
Posts: 16
Joined: Wed Aug 16, 2006 12:00 am

Re: Series Export as Excel

Post by Activex7 » Fri Dec 09, 2011 9:50 pm

Hi sandra, thanks for the reply it did solve one of my problems with the header. The other one unfortunately remains, the issue with date being exported as a number, and it appears that there is no solution for this other than going to each document and modifying the column type to date. Opening of each Excel document and formatting does not help in my case, as there are a lot of Excel spreadsheets generated.

Thanks for your help,

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Series Export as Excel

Post by Sandra » Mon Dec 12, 2011 1:13 pm

Hello Activex7,

I recommend you take a look in this link where Narcís explain, because the date is a number and one possible solution. Moreover, you have another option, save the doc as Text but with extension .xls as do in next example:

Code: Select all

Private Sub Form_Load()
  TChart1.Aspect.View3D = False

  TChart1.AddSeries scLine

  TChart1.Series(0).XValues.DateTime = True
  
  Dim month, year, i As Integer
  i = 0
  For year = 2003 To 2009
    For month = 1 To 12
      TChart1.Series(0).AddXY DateValue("1/" & Str$(month) & "/" & Str$(year)), Sin(i / 10), "", clTeeColor
      i = i + 1
    Next month
  Next year

  TChart1.Export.asText.SaveToFile "C:\tmp\test.xls"
End Sub 
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply