Hello,
i have a listgrid that i'm doing a csv-export function for. I has a datasource that has datetime firlds:
<field name="inTime" type="datetime" title="In time" required="true"/>
I use the exportData method on the listgrid. The code to do this:
DSRequest dsRequestProperties = new DSRequest();
dsRequestProperties.setExportAs(exportFormat);
dsRequestProperties.setWillHandleError(true);
dsRequestProperties.setExportDisplay(display);
dsRequestProperties.setAttribute("exportFilename", fileNameCreator.createReportName());
if(reportFields != null){
dsRequestProperties.setExportFields(reportFields);
}
dsRequestProperties.setExportDelimiter(delimiter);
reportGrid.exportData(dsRequestProperties);
My problem is that the datetime fields have leading zeros stripped out:
Example: 2016-03-29 09:03:260.0 becomes "2016-3-29 9:3:26.0" in the csv file
I am probably missing some config somewhere, but i cannot for the world find it.
If you have any ideas what i can look at, it would be appreciated. Thanks.
i have a listgrid that i'm doing a csv-export function for. I has a datasource that has datetime firlds:
<field name="inTime" type="datetime" title="In time" required="true"/>
I use the exportData method on the listgrid. The code to do this:
DSRequest dsRequestProperties = new DSRequest();
dsRequestProperties.setExportAs(exportFormat);
dsRequestProperties.setWillHandleError(true);
dsRequestProperties.setExportDisplay(display);
dsRequestProperties.setAttribute("exportFilename", fileNameCreator.createReportName());
if(reportFields != null){
dsRequestProperties.setExportFields(reportFields);
}
dsRequestProperties.setExportDelimiter(delimiter);
reportGrid.exportData(dsRequestProperties);
My problem is that the datetime fields have leading zeros stripped out:
Example: 2016-03-29 09:03:260.0 becomes "2016-3-29 9:3:26.0" in the csv file
I am probably missing some config somewhere, but i cannot for the world find it.
If you have any ideas what i can look at, it would be appreciated. Thanks.
Comment