This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Report field is not exporting as a date in Excel

Greetings, Background: I am attempting to export a report in Report Editor that contains a datatime field and  would like to export the field in excel as a date format. When the report is exported into Excel, my fields displays a string and not as a date. The user would have to perform an extra step and use the excel function for 'Text to Columns' to convert the columns to a date. I have tried the following formats below along with using the expression in the report to convert to date but my fields still export as a string. I have also made sure that the 'Text Format" in the properties is set to 'Date'. I was looking through the Stimulsoft forums but was not able to locate any other users with the same scenario I have described. I have tried exporting in xls and xlsx formats. We many reports with multiple date fields and some would run daily. This would mean that the users would have to convert the dates in excel every time the report is executed. Is there another expression or setting that I need to update so the fields exports as a date in Excel?

I have tried the following but none of these solutions is working for me:

SQL CONVERT(VARCHAR,mydate,101) AS 'MyDate', CAST(mydate AS DATE) AS 'MyDate',

Expression

{Format("{0:MM/dd/yyyy}", MyDate)}

 

Thanks in advance,

  • What is MyDate in this case, a property from a Data Source or a variable? What type has MyDate in the report?

    One thing I found after googling this, was to set the TextFormat property of the textbox in the report to a specific Date format instead of using General. If the value is set to general, then the value is exported as "text".

    You should do the same if you want to export numbers.

    HtH

  • Hi Markus,

    Sorry for the confusion but the "MyDate" was just used for the example. In my actual queries I am actually using person.exitdate and person.entrydate. I have also tested this with other datetime fields from other tables. I would expect for these two fields to export as dates.

    I have verified the Text Format under the properties and it is are set to "Date" format. I have also verified that the "Type" under 1.Data Properties is set to datetime. Are you currently able to test and export a report with a date field in date format? We are using version 8.0

    Thanks