Get Free Trial
Get Free Trial

Issue when export to excel with customize some cell

Jaffrezic asked on September 9, 2019

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

Attachments:
exporttoexcel.png

11 answers

Public
Vera Didenko Flexmonster September 9, 2019

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

Public
Jaffrezic September 10, 2019

Hi Vera
Thank for your answer.
But for us it’s a real problem.
Have you a solution for resolve this issue ?
Franck

Public
Vera Didenko Flexmonster September 10, 2019

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

Public
Vera Didenko Flexmonster October 8, 2019

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

Public
Dmitry Shtefan January 28, 2020

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

Attachments:
exporttoexcel2.png

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 29, 2020

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

Public
Dmitry Shtefan January 31, 2020

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

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 31, 2020

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

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster 2 days ago

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

Public
Jaffrezic 2 days ago

Hi Mykhailo
it still does not work 🙁
exemple : 
https://jsfiddle.net/vysnL2or/
 
Franck
 

Attachments:
customizecell.png

Public
Dmytro Zvazhii Flexmonster 2 days ago

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

Please login or Register to Submit Answer