Support Article
Date format is changed in excel when summary func is used in RD
SA-6863
Summary
When summary function is used for a column in a report defiition with a date column and when the Report Definition is executed, the date is shown in correct format. However, when the data is exported to excel the date format shown is in 24hrs format although in UI we see it as 12 hrs format
Resolution
This issue is resolved through the following local change:
<%
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, PRDateFormat.DEFAULT_DATETIME_LONG, curProp.toDate());
tools.putSaveValue("result",sDatetime);
}
else {
tools.putSaveValue("result",tools.getActiveValue());
}
%>
<pega:reference name="$save(result)" />
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.