Excel export : We found a problem with some content in '.xlsx'. Do you want us to try to recover
Excel export : We found a problem with some content in '.xlsx'. Do you want us to try to recover
When i open the exported file, I get the below error
" We found a problem with some content in 'filename.xlsx'. Do you want us to try to recover as much as we can?"
This is how i am using datatable
<script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.flash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://nightly.datatables.net/buttons/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.print.min.js"></script>
"buttons": [
{
extend: 'excelHtml5',
title: "test",
filename: "testFile",
"createEmptyCells" : true,
sheetName: 'sheetName',
messageTop: "message",
customize: function( xlsx ) {
//my code
}
}
]
How to get rid of it? Please help me on this
This question has an accepted answers - jump to answer
Answers
Try removing this part:
Then does it work? If so, then its your customisation code that is causing the issue .
Allan
Yes. It works fine by removing //my code.
I will have a look at my customization code
I'm having a similar problem and at first I thought it was my custom code. However I get the same error when using the example page: https://datatables.net/extensions/buttons/examples/html5/simple.html
I've attached a screenshot -** this only happens in Internet Explorer **(11 in my case, I can't test it in others).
Hope you can help!
If it's any help, the problem seems to have occurred since buttons version 1.5.1 and 1.5.2 because if I use 1.5.1 it works fine.
Yes, I'm afraid this is an IE11 / Buttons 1.5.2 bug. It is tracked here.
Allan
Ah no problem - thanks for the reply.
@allan, fix does not work for IE, still getting error
see details:
Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Replaced Part: /xl/worksheets/sheet1.xml part with XML error. A qualified name cannot contain multiple colons. Line 1, column 922.
@joshie373 - Are you using the nightly version of the Buttons HTML5 export? There is discussion about the fix in the nightly in the thread I linked to above.
Allan
I am experiencing this as well in IE11. Here are my version dependencies
"jquery": "3.3.1",
"datatables.net": "1.10.19",
"datatables.net-bs": "1.10.19",
"datatables.net-buttons": "1.5.3",
"datatables.net-buttons-bs": "1.5.3",
"jszip": "3.1.5",
Do I need to fallback to an earlier version of buttons to make the export to excel work?
As per this thread I don't believe Buttons 1.5.3 has been released yet. At least I don't see it on the Download Builder page.
https://datatables.net/forums/discussion/comment/137983/#Comment_137983
As mentioned above and in the thread I posted you should try the nightly version.
Kevin
Well...that's what I pulled in from npm. Says it was released 3 months ago.
https://www.npmjs.com/package/datatables.net-buttons
Sounds like there was a packaging issue causing the Datatable versions to show one version higher than they are:
https://datatables.net/forums/discussion/comment/138755/#Comment_138755
So, it seems you are still using Buttons 1.5.2 which has the issue you are asking about.
Kevin
Oh that is odd but makes sense. Thanks for the info.
Hah - yes. I've gone and confused myself with this. Buttons 1.5.4 is the one which will carry this fix. Working on wrapping stuff up for that at the moment.
Allan
Any idea when it will be available?
Soon
I am using Buttons 1.5.4 (according to CDN) and the problem is not resolved. I have looked at the “nightly version”, but I’m not sure whether to swap out the datatables.buttons.js or the exportFlash(?).
I have customized (hacked) the buttons and the colvis to show checkmarks on the visible columns so downloading a whole new build is not ideal.
I’m not really a javascript gurú- more of a full-stack hacker. But I am on a timeline - and introducing Datatables to upper mgmt - and it would really nice if it would work in their favorite browser :-)
Any advice would be appreciated!
Has there been a fix for this yet? Thanks.
Hi @rimshot609 ,
This was addressed in the 1.5.4 release, which is out now, Are you still seeing the problem? If so, could you please link to a test case. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Was having the same issue...1.5.4 fixed it for me!
Thanks all