Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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.
 
  1. Open the “Export_DateTime” HTML Property rule instance on your system.
  2. Perform a “Save As” of the HTML Property, specifying a new “Stream Name” and custom Ruleset and Ruleset version.
  3. In the new control set the date formate as PRDateFormat.DEFAULT_DATE_SHORT_YYYY 
  4. Update the new HTML property to add the code below to the existing code.
(In the below div tag the style must be the format which we want to export to excel.)
 
<div class="excel-date" style="vnd.ms-excel.numberformat:@">
 
{existing code}
</div>
 
  1. 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.
  2. Save the rules, execute the report definition and perform an Export to Excel.
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us