Page 1 of 1

Export DateTime in excel

Posted: Tue Dec 18, 2007 6:34 am
by 9534693
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:

Posted: Tue Dec 18, 2007 9:57 am
by narcis
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.

Posted: Wed Dec 19, 2007 5:37 am
by 9534693
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.

Posted: Mon Dec 24, 2007 10:54 am
by Pep
Hi,

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