Date field as Text when exporting to Excel

Stimulsoft Reports.NET discussion
Post Reply
Vumse
Posts: 2
Joined: Fri Feb 01, 2019 1:20 pm

Date field as Text when exporting to Excel

Post by Vumse »

Greetings,
My Issue:
I am trying to export a report with Text fields formated as Date into Excel.
After export, in Excel file, the fields have Date formate but looks and behave as strings. I can't filter or make any calculations with Date columns properly (because all values displays as strings).
But if i change formula of that type of field (Excel F2 - hotkey) and press Enter, then field magically starts to behave and act as date (filter, etc)

How that problem can be solved in terms of stimulsoft?

Tried:
Export as previous Excel versions (2003\1997)
Change Text Format in Stimulsoft to Number (with number type there is no such problem) but still displays as "43000"+
Use severals internal functions and formats - no good.

I'm using Stimulsoft Version 2013.2.1700 from 19 September 2013
Attaching Report with some data and exported Excel File.

(how i export: Preview > Save As > Excel)
Unfortunately I can not make changes in Excel file

Thanks in advance
Attachments
ReportTemp.mrt
(22.56 KiB) Downloaded 122 times
Lech Kulikowski
Posts: 6237
Joined: Tue Mar 20, 2018 5:34 am

Re: Date field as Text when exporting to Excel

Post by Lech Kulikowski »

Hello,

When exporting to Excel, the default date and time are exported as text, although the cell format is set to Date or Time. This is due to the fact that in a rendered report the date and time are stored as text strings. For Excel97, you can enable the export of these values ​​using the static property:
 StiOptions.Export.Excel.AllowExportDateTime = true;

When exporting, text lines will be parsed using ReportCulture or CurrentCulture, and then the resulting values ​​will be written to Excel in the default format. Therefore, for proper parsing, must be taken that the text strings date and time are recorded with the appropriate regional settings.

In Excel2007, the export of date and time is not yet implemented.

Thank you.
Vumse
Posts: 2
Joined: Fri Feb 01, 2019 1:20 pm

Re: Date field as Text when exporting to Excel

Post by Vumse »

Thank you for your response,
Export with Excel97 works well.

Hope that feature will be implemented soon :)
Lech Kulikowski
Posts: 6237
Joined: Tue Mar 20, 2018 5:34 am

Re: Date field as Text when exporting to Excel

Post by Lech Kulikowski »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply