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

Date Format varies when exporting to Excel from report defintion



When exporting  a report to Excel from the Report browser, the Date format in Excel varies from the Date format in the Report browser.

Error Messages

Not Applicable

Steps to Reproduce

  1. Launch any portal.
  2. Click Reports.
  3. Open any report.
  4. Click Actions.
  5. Select Export to Excel.

Root Cause

When the default out-of-the-box DateTime format was provided in the report definition and exported to Excel, the Excel changed the Date format to the system Date format.


  1. Apply HFix-41497.
  2. Create a new Date control using the below code and provide this control in the report definition at the field level.

    <div class="excel-date" style="">
    ClipboardProperty curProp = tools.getActive();
    if ((curProp.getType() == PropertyInfo.TYPE_DATE || curProp.getType() == PropertyInfo.TYPE_DATETIME)&& curProp.size() > 0 && curProp.hasValidValue() && curProp.toDate()!=null)  {
                    String sDatetime="";
                    String type = tools.getParamValue("DateTimeFormat");
                    String strTimeZone = tools.findPage("pxRequestor").getString(".pyUseTimeZone");

                    sDatetime = PRDateFormat.format(null, strTimeZone, "dd/MM/yyyy", curProp.toDate()); 
    else {

      <pega:reference name="$save(result)" />

Published August 15, 2019 - Updated October 8, 2020

Was this useful?

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.

Did you find this content helpful?

Want to help us improve this content?

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