Bug Report T291950
Visible to All Users

Values from TimeSpan? columns are exported incorrectly

created 9 years ago (modified 9 years ago)

One of our users notified us that the time column in the excel export of a grid wasn't displaying properly. I've never notice this before so I guess it's a new issue.
The TimeSpan in a column is exported as a number between 0 and 1 instead of a proper time format. The "Format Cell" option in Excel shows me that the column is exported as a "General" format. Once I put it on "Time" format the time displays properly. Has something changed within this ExportToXls method or has it always worked like this?

A small sample of what is exported to Excel:

Actienummer    Startdatum    Starttijd
4                     10-10-2012      0,770833333
3                     10-10-2012      0,770833333
9                       12-9-2011      0,109027778
3                       11-9-2011      0,935416667
5                         9-9-2011     0,906944444
What can I do to get the export to show proper time formats (i.e. 't' or 'T' mask)?

Thanks,

Yoni

Comments (3)
DevExpress Support Team 9 years ago

    Hello Yoni,

    I cannot replicate this issue on our side by using the attached sample project. Would you please modify this project or post your own so I can reproduce the issue? I will investigate it and try to find an appropriate solution.

    Thanks,
    Elliot

      Hi Elliot.
      I noticed that the problem is the fact that our TimeSpan is actually a nullable TimeSpan. This also goes for the DateTime as well. I've modified your sample to illustrate my issue.
      Thanks,
      Yoni

      DevExpress Support Team 9 years ago

        Thank you for your sample, Yoni. It seems strange that values are exported incorrectly only when the data source property is nullable, and I will inform our developers about this issue. We will let you know once we find the cause of the problem.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.