Hi,
I used the customizeCell for customize some cells, but when I export to excel the format for changed cells is not correct
see screenshot
and exemple on fidle : https://jsfiddle.net/s1c28nzp/
Thank
Franck
Hello,
Thank you for writing to us.
We would like to explain that cell data which is customized with the customizeCell()
API call is exported as a string.
The reason for this is that we cannot predict the data type of customized cells for all cases.
Therefore, we generalized all customized cells to be of type string.
In your case, when exported to Excel, such cells can't be used in a formula because they are of type string, not number.
Please let us know if you have any questions.
Best Regards,
Vera
Hi Vera
Thank for your answer.
But for us it's a real problem.
Have you a solution for resolve this issue ?
Franck
Hello, Franck,
Thank you for your response.
Our development team has looked into your case with more detail.
The fix will be available in the minor release version with the ETA October 7th.
You are welcome to contact us in case of questions.
Best Regards,
Vera
Hello, Franck,
We are happy to let you know that now if the data cell was changed with customizeCell
approach and the new value also has type number, it will be exported to Excel as a number.
This is available in the 2.7.16 version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
Please contact us in case any questions arise.
Best Regards,
Vera
Hello Vera,
I'm testing the latest 2.7.24 version of Flexmonster and it seems it has the same problem:
if customizeCell
function is defined, when the report is exported to Excel, the numbers data format is string.
Example (excel screen is also attached):
https://jsfiddle.net/xtmc1sdw/
Could you please check and fix it?
Thank you,
Dmitriy
Hello,
Thank you for your question.
Our team has investigated the problem, and we agree that current behavior is still inconsistent.
The fix is going to be provided with a minor update ETA Feb 24.
For now, we would like to give some additional information about the issue that can possibly help with a temporary workaround. Values in the exported excel file will be presented as numbers in case customizeCell
API directly overrides the content of the cell with a numeric value. For example:
flexmonster.customizeCell(function(cell, data) { if (data.type == "value") { cell.text = data.value;
} });
Please refer to the example demonstrating that approach.
You are welcome to contact us in case of additional questions.
Best regards,
Illia
Hello Illia,
Thanks for your response.
Unfortunately, the workaround above hasn't helped much, because in this case we miss numbers formatting, e.g. thousands separator.
At the same time, we have found that on Excel export we can define useCustomizeCellForData=false parameter, that completely suits our logic and solves this problem (we are using customizeCell function only for dimension data).
Best Regards,
Dmitriy
Hello,
Thank you for your feedback.
We are happy you have resolved the problem.
You are welcome to contact us in case any additional questions arise.
Best regards,
Illia
Hi Dmitry,
We are glad to announce that the issue with customizeCell
and export to Excel was fixed.
This is provided in the 2.8.1 version of Flexmonster: https://www.flexmonster.com/release-notes/
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance: https://www.flexmonster.com/doc/updating-to-the-latest-version/
Also, here is a 2.7 to 2.8 migration guide which might come in handy since our 2.8 release: https://www.flexmonster.com/doc/migration-guide-from-2-7-to-2-8/
Feel free to write to us in case of questions.
Best regards,
Mykhailo
Hi Mykhailo
it still does not work 🙁
exemple :
https://jsfiddle.net/vysnL2or/
Franck
Hello Franck,
Thank you for writing to us.
For such cases, we cannot predict what is going to be inserted into a cell. Therefore, we treat such things as strings.
We recommend using the following approach to make Excel export working as expected: https://jsfiddle.net/flexmonster/z0Loqref/.
Does it work for you?
Regards,
Dmytro