Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

fpSpreadsheet date formats

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark E. Skeels

All...

I am using fpSpreadsheet and trying to read spreadsheet cells containing dates from one worksheet and write them to another.

The written cells' formats are being changed to the integer representation of the dates.

I either need to reformat them before writing or get the new worksheet cells' format set to properly display the dates.

I get the same results whether using Open Office Calc or Excel.

Does anyone know what is going on here and can steer me in the right direction?

Is there some function in Lazarus that will allow me to convert the integer to a string and write the string?

Thanks....

Skeels Technical Services 9714 Norman Ave. Machesney Park, IL 61115 815-639-9777 skeelstechservices.site11.com

Reply by email

Hans-Peter Diettrich
to Mark E. Skeels
Show quoted text 8 lines
I am using fpSpreadsheet and trying to read spreadsheet cells containing dates from one worksheet and write them to another. The written cells' formats are being changed to the integer representation of the dates. I either need to reformat them before writing or get the new worksheet cells' format set to properly display the dates.

This may be very spreadsheet dependent. IMO you should try to copy&paste, using the clipboard, so that the spreadsheet can copy the (binary) value, regardless of the display format of the cell(s).

DoDi

Reply by email

Marc Santhoff
to Mark E. Skeels: All... I am using fpSpreadsheet and trying to read spreadsheet cells containing dates…
Mark E. Skeels wrote 15 lines
All... I am using fpSpreadsheet and trying to read spreadsheet cells containing dates from one worksheet and write them to another. The written cells' formats are being changed to the integer representation of the dates. I either need to reformat them before writing or get the new worksheet cells' format set to properly display the dates. I get the same results whether using Open Office Calc or Excel. Does anyone know what is going on here and can steer me in the right direction?

That's the way spreadsheet programs work. A date is an integer behind the scenes, what makes it look like a date string is the formatting.

If your target cells have to be read using openoffice or excel you will have to change the format for visualization to date display. If you have problems inside fpSpreadsheet you might have to do something similar (never used it) or convert the date serials from other programs to date types (TDateTime).

Marc Santhoff

Reply by email