Get Free Trial

date string taken as string in exported excel file

amir asked on September 21, 2020

I have flexmonster flat table and other charts used at multiple locations in my application. The problem is with columns with type set to date string. When I export the table to an excel file and try to apply a filter to excel columns for that date it doesn’t show date filters but shows string filters. 
To resolve this when I tried to set the data type to date it is separating the day, month, and year into separate columns which is not the expected behaviour. I want the entire date to be in a single column without the time.

3 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 22, 2020

Thank you for contacting us.
Our team wants to explain that we did not manage to reproduce the problem using the date string data type. Please see the JSFiddle we have prepared trying to catch the issue.
Therefore, we want to ask you for a sample where the problem could be seen. You are welcome to use the mentioned JSFiddle as a template.
We are looking forward to hearing from you.
Best regards,

amir September 22, 2020

Thank you for your response. Please open the attached file into flexmonster and then you can reproduce the issue I am facing 

While analysing the issue i found some unique behaviour. If my data has at least on column with data type number then the date string works as expected. Like if i remove data from your sample provided in jsFiddle with data type number then this problem comes in this case also

report (8).json

Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 23, 2020

Thank you for providing us with an example. It helped to bring some light on the nature of the problem.
The reason for such a behavior is the way Excel operates with ranges when adding filters.
When trying to add the filter to the first row, Excel scans the row next to it and tries to retrieve the data type. In case nothing is found, it infers that the data type is string.
At the same time, Flexmonster uses the second row of the table to display grand totals.
As a result, in case no grand totals present (for example, no number data type present in the slice), the second row appears blank. The blank row persists in the exported file and affects the process of retrieving the data type.
Therefore, we suggest changing the position of totals using the options.grandTotalsPosition property. Define its value as bottom to avoid the described behavior.
Please see an example we have prepared for you.
Detailed information about the options object and its properties can be found in our documentation.
Another option is to select an appropriate range before creating a filter in Excel. For example, it is possible to select the blank row itself or the first row with the data before creating the filter.
Our team sure hopes it works for your case.
Do not hesitate to contact us in case any further questions arise.

Please login or Register to Submit Answer