Page 1 of 1

Series Export as Excel

Posted: Wed Dec 07, 2011 10:47 pm
by 9347200
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

Re: Series Export as Excel

Posted: Fri Dec 09, 2011 12:27 pm
by 10050769
Hello Activex7,

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

I hope will helps.

Thanks,

Re: Series Export as Excel

Posted: Fri Dec 09, 2011 9:50 pm
by 9347200
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,

Re: Series Export as Excel

Posted: Mon Dec 12, 2011 1:13 pm
by 10050769
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,