Export DateTime in excel

TeeChart for ActiveX, COM and ASP
Post Reply
egenNilesh
Newbie
Newbie
Posts: 9
Joined: Thu Mar 29, 2007 12:00 am

Export DateTime in excel

Post by egenNilesh » Tue Dec 18, 2007 6:34 am

HI..I have datetime values on x axis of teechart. On export of data to excel it show's floating point number.

i have make datetime as true in vb 6 code as follows:

TChart1.Series(0).XValues.DateTime = True

So how i can export datetime as datetime format not as floating point values.
:shock:

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 18, 2007 9:57 am

Hi egenNilesh,

This is because TeeChart internally saves DateTime data as doubles as you can read on TDateTime documentation. Notice that TeeChart Pro ActiveX is a COM wrapper of the TeeChart Pro VCL version.

Also, generated Excel file has all cells set to General format. You should set those cells you want to see in DateTime format to Date format in Excel.
Best Regards,
Narcís Calvet / 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

egenNilesh
Newbie
Newbie
Posts: 9
Joined: Thu Mar 29, 2007 12:00 am

Post by egenNilesh » Wed Dec 19, 2007 5:37 am

HI..Narcís,

Thanks for reply.....so is there anyway to save datetime format in excel without formatting excel sheet. I have tried to get datetime value in string
, still it store in double value.

Since excel sheet generated during save teechart data as new excel sheet, that's why it is difficult to format that cell.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Dec 24, 2007 10:54 am

Hi,

I'm afraid there's not other way to do it other than modify the format of the Excel cells.

Post Reply