Support Article
On Export To Excel Date format inconsistently as MM-DD-YYYY
SA-5839
Summary
On Exporting to Excel of ListView data, the ListView date property data coming on to excel as "DateTime Format".
(using currently "Date-Calendar" control.)
Error Messages
No error message, But Date Format is wrong on export to excel, Inconsistent with displayed Listview date format (MM/DD/YYYY)
Resolution
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:@">
{existing code}
</div>
- 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.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.