🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all the hot features!
Get Free Trial

Export excel with date columns retaining the data type

Sangamesh asked on August 13, 2019

Date source is CSV fetched from API.
API returns date columns in the format dd-MMM-yyyy. Ex: (…,11-Nov-2019,…)
How to handle this in flexmonster  UI so that when the drill through report is exported to excel, the date columns will retain their data type as date in excel instead of plain text?

3 answers

Vera Didenko Vera Didenko Flexmonster August 13, 2019

Thank you for writing to us.
We would like to mention that data representing dates needs to be specified in the ISO 8601 date format.

At the moment, in Flexmonster date fields represented as measures retain their data type as date when exported to Excel.
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/s48e6jah/

Please let us know if this works fine for your use case.
Best Regards,

Sangamesh August 14, 2019

Thanks. As per your example where should i include below code?
data: [
My implementation is in typescript is as below 

public pivotReport: any;
this.pivotReport = {
dataSource: {
dataSourceType: “ocsv”,
filename: Url,
slice: {
reportFilters: [],
rows: [],
columns: [],
measures: [
drillThrough: []


Vera Didenko Vera Didenko Flexmonster August 15, 2019

Thank you for your reply.
For CSV/OCSV data sources a special prefix needs to be added to the field column name. 
Please see our data types in CSV tutorial for guidance.
The prefixes specify how data should be interpreted by Flexmonster.
In case data is fetched from SQL database, we kindly suggest setting the Flexmonster data types prefix dt+ explicitly via SQL query alias.
Here is an example: 

"SELECT segment as 'Segment', post_date as 'dt+Post Date' FROM customers"

Please let us know if it works for you.
Best Regards,

Please login or Register to Submit Answer