Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

File is corrupted on excel export (.xlsx)

Answered
Paavo Väänänen asked on June 23, 2020

Hey,

I’ve ran into a weird problem which turned out pretty hard to debug. We have two different contexts in our application, one of which exports the same report (grid) as a normal working file and the other as a corrupted one that cannot be opened. The only differences between these two contexts are in the Options object of the report.

The working one has the following: { …, chart: { …, showFilter: false, showMeasures: false, type: “number” }, configuratorButton: false, grid: { …, title: “” } }.

The non-working one on the other hand, has the false values as true, and chart.type = “column” and grid.title = “[title of the report]”.

As mentioned the reports are otherwise identical. Also, the other export types (.csv, img, pdf, html, print) work in both contexts.

Any advise?

Best,
Paavo

14 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 23, 2020

Hello,
 
Thank you for reaching out to us.
 
We want to kindly inform you that we did not manage to reproduce the problem using the latest version 2.8.9 of the component. Please see an example we have prepared trying to reproduce the issue.
 
It would be useful for our investigation if you could modify the provided example so that the described problem appears.
 
Our team is looking forward to hearing from you.
 
Best regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 1, 2020

Hello,
 
We are just wondering whether you had a minute to prepare the sample where the described problem would be reproducible.
 
Our team is looking forward to hearing from you.
 
Regards,
Illia

Public
Paavo Väänänen July 2, 2020

Hello,

Sorry for a late reply. I was unable to make a “working” for you. We are working on updating the component to the latest version, which might solve the problem.

I was just wondering if someone has ever reported similar issues (even on the previous versions of the component)?

Thanks for looking into it.

Best,
Paavo

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 2, 2020

Hello,
 
Thank you for your feedback.
 
Our team would like to inform you that no similar issues were reported by our clients.
 
Please let us know whether the update helps to resolve the problem.
In case the issue persists, we want to ask you to provide us with an example where the problem would be reproducible. It will dramatically help us with an investigation.
 
We are looking forward to hearing from you.
 
Regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 15, 2020

Hello,
 
Our team is wondering whether you had some time to prepare the sample where the problem with exporting would be reproducible.
 
We are looking forward to hearing from you.
 
Regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 27, 2020

Hello,
 
We want to take an interest in whether updating to the latest version did manage to resolve the problem.
 
Our team is looking forward to hearing from you.
 
Best regards,
Illia

Public
Toni Laukka September 3, 2020

Hi!
We haven’t been able to update to 2.8.* since updating Flexmonster breakes our custom components. So for now we are stuck with versioin 2.7.22 and with the problem. How would one debug export? I would like to find out why it works in our other component and the other fails. Or it doesn’t fail but rather corrupts the excel file and when you try open it Excel says:

“We found a problem with some content in ’pivot (3).xlsx’. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.”

If you click yes, you get another error:

“The workbook cannot be opened or repaired by Microsoft Excel because it is corrupt.”

BR,
Toni 

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 4, 2020

Hello,
 
Thank you for providing the details.
 
We want to ask you for more information about the reasons preventing you from updating to the latest version of Flexmonster. For example, what are the mentioned custom components which are going to be affected by the update?
Our team is ready to assist you with a migration process. Moreover, updating is likely to resolve the issue with export.
 
Also, please provide us with the following information so that we could try reproducing the issue on our side:

  • Sample data sets used when the problem with export arises (dummy data can be used).
  • Sample reports (configuration of the pivot) used when the problem arises.

 
Our team is looking forward to hearing from you.
 
Best regards,
Illia

Public
Toni Laukka September 7, 2020

The file corruption was caused by an illegal character at the title. Illegal char was &. Are there any other illegal characters or limitations to the title? Max length etc.?
Is there other way than strip illegal characters? & won’t work either.

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 7, 2020

Hello,
 
Thank you for providing us with details. It brought some light on the nature of the problem.
 
We want to explain that the ampersand symbol is allowed to use in the worksheet’s name by Excel. The issue with files corruption will be fixed with a minor update ETA Oct 05.
We will notify you as soon as the version with a fix is available to download.
 
Concerning general limitations imposed on the worksheet’s name:

  • Excel does not allow using the following characters: \, /, ?, *, [, ], :.
  • The name of the worksheet must not exceed 31 symbols.

 
We hope it works for you.
Please contact us in case any further questions arise.
 
Regards,
Illia

Public
Toni Laukka September 8, 2020

The problem is with { options: { grid: { title: ‘title’ }}} Object.
Reproduction of the error: https://jsfiddle.net/tonilaukka/19y6kqhx/6/
Exported Excel file is corrupted because of the & character in the title

Other illegal characters work just fine: https://jsfiddle.net/tonilaukka/19y6kqhx/7/

Title also works fine when it’s longer than 31 characters: https://jsfiddle.net/tonilaukka/19y6kqhx/9/

So is it enough to just replace &-character of the title when exporting? https://jsfiddle.net/tonilaukka/19y6kqhx/20/

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 8, 2020

Hello, Toni,
 
Thank you for the clarification and for preparing examples.
 
The fix for this problem will be provided with a mentioned minor update ETA Oct 05 as well.
As a temporary workaround, we recommend not to use the “&” symbol in the title.
 
Finally, we want to notice that the mentioned set of limitations applies to the worksheet’s name only. It means the grid’s and chart’s titles are not limited in size or used characters.
 
We hope it works for you.
Please contact us in case other questions arise.
 
Best regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster October 6, 2020

Hello,
 
We are pleased to inform you that the issue with a corrupted Excel file when using special characters in the worksheet’s name or the grid/chart title was fixed.
 
This is provided in the 2.8.17 version of Flexmonster.
 
You are welcome to update the component.
Here is our updating to the latest version tutorial for guidance.
 
Please contact us in case any questions arise.
 
Kind regards,
Illia

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster October 13, 2020

Hello,
 
Our team is wondering whether the recently provided fix works for you.
 
We are looking forward to hearing your feedback.
 
Best regards,
Illia

Please login or Register to Submit Answer