Format date and export excel versus csv

Resolved

 Hi,
I have a pivot with a measure type date, I use property ‘customizeCell’ for format my date. 
When I exported csv the date is OK, but when I exported excel the date is not ok is the number (see screenshot).
Thanks

4 answers

Public
Ian Sadovy Flexmonster April 26, 2018

Hello Jaffrezic,

 
Thank you for the question.
For Excel export, we apply customizeCell only to strings.
It was done to keep native types and allow Excel to format and work with number/dates as usual.
In your case, we recommend using datetime data type and specify dateTimePattern insted of using customizeCell.
Please refer to the following sample – https://jsfiddle.net/flexmonster/dyLwq040/
Please note, that in Excel you will see dates in the default Excel format, but you can further apply custom format.
 
Hope it helps.
 
Regards,
Ian

Public
Jaffrezic April 27, 2018

Hi Ian
Thanks for you answer. Unfortunatly it doesn’t work with my code. 
I would like display date and not count(date).
Please refer to the following sample – https://jsfiddle.net/6zfm4a98/ you will see it display the count date but I would like display date
Regs
Franck
 

Public
Ian Sadovy Flexmonster April 27, 2018

Hello Jaffrezic,
 
I have updated your sample, please take a look – https://jsfiddle.net/flexmonster/6zfm4a98/2/
If you want to show datetime on the pivot grid, you need to specify an aggregating function (it cannot be none). 
Instead of count you can use min/max , so it will show appropriate dates on the grid.
Please let me know if it works.
 
Regards,
Ian 
 

Public
Jaffrezic April 27, 2018

Hi Ian
Thanks
It works fine
Franck
 

Please login or Register to Submit Answer