Question
Coforge
US
Last activity: 19 Aug 2016 9:06 EDT
Data Type export of DateTime properties
We are trying to export the data table which has DateTime property. So that users can add data to it, but when its being exported the yyyyMMddThhmmss.000GMT. This is not that much understandable by business, is there a way to format it into a more user friendly format so that the export to excel (csv) will have the text in the required format.
***Updated by Moderator: Vidyaranjan. Removed user added #helpme tag. Apologies for confusion, shouldn't have been an end-user option***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
EPAM Systems, Inc.
ES
Hi Imran,
I guess it's possible by adding an inline style-sheet in the DateTime property, which you intend to export.
Add any of the below format based on your requirement in the inline style sheet:-
@(Pega-RULES:DateTime).DateTimeDifference(@(Pega-RULES:String).toDate(Param.Input),@(Pega-RULES:String).toDate("20160621"), "D")
@(Pega-RULES:String).substring( @(Pega-RULES:DateTime).CurrentDateTime(), 0, 4)+"0101"
As inline style in the cell of the input field to ensure that in excel sheet text format remains same as in section rule.
Or else, you can alter the "ExportToExcel" activity and call a data transform to iterate over the particular DateTime property to change the format of the property.
Coforge
US
Hi Asif,
Its the pega OOTB export feature which we are using for the data tables export. We didn't see any rule which we can override to set the export format out. Little bit more information would be very helpful. Thank you!
BNZ
NZ
Hi,
You can modify the list view DataTableClassEditor and include Date Related Control under Export Format of that particular column. this list view will be there in your data table class.
When user exports the data to excel, this control will kick in and shows the user friendly format. User can enter the data in the same format. When user enter a date, this might be automatically converted to date timestamp when saving the data to data table (better to check the clipboard to verify the format of the value). if any issues are encountered during saving of user entered date, then you may need to specalize the OOTB rule which is called while saving this data to your data table in your data table class.
Regards,
Naveen.
Coforge
US
Hi Naveen,
Making changes to the DataTableClassEditor did not solve the issue. Still the values are exported in are exported in the yyyyMMddThhmmss.000GMT. When we tried looking into the issue, we noticed that all the rules are final. Starting from pzDownloadDataRecordsAsCSV.
Just now I noticed that there is a similar post on applying formatting for export to excel - https://collaborate.pega.com/discussion/export-excel-grid-report-definition-source
Coforge
US
The activity pxConvertResultsToCSV is the one which is generating the CSV file. Is there a way to apply styles or enable the activity to make use of the readonly format for the datetime property instead of the pyStringType = DateTime.
Areteans Technologies
AU
Mention the Date control in the Report definition of the data type. Each column in report defn will have a settings icon at last in that we can configure the control/format, so upon exporting the data, it will display approapriately.
Coforge
US
The default export available in the data explorer doesn't make use of the formatting in export to excel. I tried giving format it just doesn't pickup. It always applies the property mode datetime.