- Home
- Forum
- JavaScript - EJ 2
- Excel error opening exported workbook
Excel error opening exported workbook
After exporting to workbooks from the PivotView it is common to see Excel report an error while opening the exported document. An example is shown in the screenshot. The workbook being opened in the screenshot is attached. The workbook opens and appears OK but the error is confusing for users.
NOTE: The uploader for this message will not allow a file with a .xlsx extension so .zip has been added which you will need to remove to open the file.
The XML below is the content of the file shown in the error message in the screenshot.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error136560_01.xml</logFileName>
<summary>Errors were detected in file 'C:\Users\bills\Downloads\Export (5).xlsx'</summary>
<additionalInfo>
<info>Excel completed file level validation and repair.
Some parts of this workbook may have been repaired or discarded.</info>
</additionalInfo>
<repairedRecords>
<repairedRecord>Repaired Records: Format from /xl/styles.xml part (Styles)</repairedRecord>
</repairedRecords>
</recoveryLog>
Attachment: Export_(5).xlsx_44626f58.zip
Do you have any advice on what to do to avoid this error when Excel opens a workbook created by the PivotView component?
Hi Bill,
We have checked the reported excel exporting issue by header and footer and customizing the first cell (Empty cell) in the excel document. And our excel export is working fine. Please refer to the sample we checked below.
Sample: https://stackblitz.com/edit/niu5ub-lgex6x?file=index.html,index.js
Output screenshot:
If the
problem persists, please reproduce it in the
provided sample and revert to us (or) send your runnable sample with the data
source
that reproduces the problem. This would allow us to
investigate the reported problem at our end and provide a solution as soon as
possible.
Regards,
Angelin Faith Sheeba.
I can appreciate that when Syncfusion releases a version it does not believe there are bugs. Your example is one that does not produce a bug. However, the workbook I attached is invalid. The reason it is invalid is because one of the styles created by the Syncfusion component is not valid.
An Excel .xslx file is a Zip file. When it is extracted, one of the files is ./xl/styles.xml This files defines the styles used by the workbook. It is created by the PivotView component.
The screenshot below is of the top of the styles XML file. If you unzip the file attached to the first post and open styles.xml you will see the same thing. The red arrow points to the problem. 'undefined2' is not a format code Excel recognizes. This is most likely a string generated by the component when it has tried to reference a variable which is undefined.
I also appreciate you do not have data source settings object you can apply to reproduce this problem. But now you know where the problem is within the excel file, it must be possible to have an idea where in the code the invalid format code will have been created. If you can let me know file and line in the file, I can step through the code to try to learn why this happens.
I know you cannot reproduce this problem, however, I have clients who experience this issue everyday so I'd like to find a way to help fix the problem.
Thanks
Hi Bill,
Sorry for the inconvenience. We have checked the reported excel export issue with all the possible cases that we have assigned the string value and undefined to the value cells. And also we have checked it by removing the format of the value cells. But we are unable to reproduce the reported issue at our end. However, we suspect that the reported issue occurs because you are using the oldest version of our pivot table. If this is the case, we suggest you update your packages to the latest version and check the reported issue at your end and update us the details to us. Please refer the sample that we have checked.
Sample: https://stackblitz.com/edit/niu5ub-hvuvxz?file=index.html,index.js
If the problem persists, please share your code example with dummy data or reproduce the reported issue in the provided sample. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible.
Regards,
Angelin Faith Sheeba.
- 4 Replies
- 2 Participants
-
BS Bill Seddon
- Oct 23, 2023 11:12 AM UTC
- Oct 27, 2023 01:38 PM UTC