On Export To Excel Date format inconsistently as MM-DD-YYYY
On Exporting to Excel of ListView data, the ListView date property data coming on to excel as "DateTime Format".
(using currently "Date-Calendar" control.)
No error message, But Date Format is wrong on export to excel, Inconsistent with displayed Listview date format (MM/DD/YYYY)
This issue is resolved through the following local change:
The issue seems to be being caused by Excel.
You can refer to http://excelsemipro.com/2011/06/regional-date-formats-in-excel/.
However there is a way to resolve this when using export to excel.
Please follow the below steps.
- Open the “Export_DateTime” HTML Property rule instance on your system.
- Perform a “Save As” of the HTML Property, specifying a new “Stream Name” and custom Ruleset and Ruleset version.
- In the new control set the date formate as PRDateFormat.DEFAULT_DATE_SHORT_YYYY
- Update the new HTML property to add the code below to the existing code.
<div class="excel-date" style="vnd.ms-excel.numberformat:@">
- Open the report definition rule you wish to update and add the new custom html property in the column Format values for the corresponding date time property field.
- Save the rules, execute the report definition and perform an Export to Excel.