This is a migrated thread and some comments may be shown as answers.

Excel export on DateTime.MinValue

1 Answer 299 Views
GridView
This is a migrated thread and some comments may be shown as answers.
superold
Top achievements
Rank 1
superold asked on 13 Sep 2010, 10:52 PM
Hi.

I have a grid which is bound to an object bindinglist. Some properties are of the DateTime type. When some value is null I need to expose them as DateTime.MinValue and format them on CellFormatting, if the value is DateTime.MinValue I set the Text of the cell to String.Empty. It works fine.

But when I export to excel xml it is exported as <Data ss:Type="DateTime">0001-01-01T00:00:00.000</Data> which excel will not read.

How do I solve this? 

I am still on RadControls 2009.3.9.1111. I try upgrading to 2010 but it was too much work to upgrade. Will do someday.

Thanks
- jorge

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 17 Sep 2010, 05:45 PM
Hello Jorge Delgado-Lopez,

Thank you for writing.

Microsoft Excel does not supports dates before 1.1.1900. That is why you encounter issues when exporting smaller values. You can try to overcome this limitation by setting a valid date value in ExcelCellFormatting event. Please refer to product documentation for more details.

Let me know if you have any additional questions.

Kind regards,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
superold
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or