Question

Molina HealthCare
US
Last activity: 11 Feb 2022 3:01 EST
Export To Excel is not recognizing the Date format, its showing as Text format for Datetime field
In Report Definition, we gave a Control to format the DateTime Field and which is working fine in UI and while exporting to excel, its showing the format but its losing the filter option as its showing General format.
Below code is used and requirement to have filter option as well.
<% String ExpectedFormat ="mm/dd/yyyy HH:mm:ss"; String returnDate=""; String inputDate = tools.getActive().getStringValue(); String state = tools.getProperty("UserSelectedState").getStringValue(); if(inputDate!="") { // oLog.infoForced("In Java method date :" + inputDate); // oLog.infoForced("In Java method state :" + state); tools.getParameterPage().putParamValue("State", state); tools.getParameterPage().putParamValue("UserSelectedState", state);
String timeZone = pega_rules_decisiontable.ObtainValue(tools, tools.getStepPage(), "SetStateSpecificTimeZone"); //oLog.infoForced("In Java method timeZone default value= :" + timeZone); try{ DateTimeUtils dtu = ThreadContainer.get().getDateTimeUtils(); returnDate = dtu.formatDateTime(inputDate,ExpectedFormat,timeZone,"en_US"); //oLog.infoForced("In Java method date converter:" + returnDate); }catch (Exception e){ oLog.error(e); }
} %>
<%=returnDate%>