Excel export 1.5.2 not working in IE11

Excel export 1.5.2 not working in IE11

KateFrancescaKateFrancesca Posts: 4Questions: 1Answers: 0

Hi,

I think I might have found a bug so wanted to report it. I've been using Datatables 1.10.16 with Buttons extension 1.4.2 for a while and this works in IE11. However, while trying to solve an unrelated problem I decided to upgrade to latest version available on the download page which is DT 1.10.18 and Buttons 1.5.2. However, as soon as I did this I found the Excel export no longer works: when I try to open the file it creates I get a message about it being corrupt and when I say yes to open anyway, I get a blank document.

Repeating the process in Chrome produces a different size file and this does open successfully in Excel. It therefore seems an IE specific bug has crept into the latest version of the Buttons extension.

You can test this with the Buttons extension examples on the website. For example, the following works fine in Chrome but not in IE, with the same issue as I found in my code detailed above:

https://datatables.net/extensions/buttons/examples/initialisation/simple.html

Note: I've tried this form two different machines running IE11 and got the same result. The version of Excel I'm trying to open it in is 2013 - I haven't yet been able to test any other versions of Excel.

I hope this bug report is useful and of course hoping it can be fixed! :) If I can provide any more information please let me know.

Thanks
Kate

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977
    Answer ✓

    This is a known issue with Buttons 1.5.2. According to other threads it should be fixed in Buttons 1.5.3 and in the Nightly versions:
    https://datatables.net/download/nightly#Buttons

    Kevin

  • KateFrancescaKateFrancesca Posts: 4Questions: 1Answers: 0

    Hi Kevin,
    I've tried using the nightly build and it has indeed solved the problem!
    Thanks
    Kate

  • gjewellsgjewells Posts: 2Questions: 0Answers: 0

    I'm sorry to seem so clueless, but I've tried applying the buttons 1.5.3 nightly and I'm getting no better results.... so I assume I'm doing something wrong since this thread (and others) seem to indicate they are now working great. Could one of you please post a quicky "to apply the nightly build, follow these steps". I can't seem to get past the corrupt Excel export error.

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977

    Replace your current Buttons CSS and JS with the nightly versions listed at the above link. If you used the Download Builder to build a bundle then you may need to create a new bundle without Buttons to use the nightly version. Hard to say without seeing your file includes.

    Excel file corruption could occur if you are doing some custom formatting and it is not correct. Meaning its not the issue with IE 11.

    Does your export work in other browsers?

    Kevin

  • gjewellsgjewells Posts: 2Questions: 0Answers: 0

    Yes it works in other browsers like a charm... just not IE11. Not doing anything fancy with the output (yet) so I assume that it's the known bug. I did use the download builder though, so that's likely the culprit. Thanks for the help Kevin :-)

  • emmKayemmKay Posts: 5Questions: 1Answers: 0

    Hey guys, also having the same problem, even with the nightly build.
    Can you advise why the nightly build may not be working?

    These are the files I have included:

    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css" />
    <link href="//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
    <script src="https://code.jquery.com/jquery-3.3.1.js " language="javascript" type="text/javascript"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js " language="javascript" type="text/javascript"></script>

        <script src="https://nightly.datatables.net/buttons/js/dataTables.buttons.min.js" language="javascript" type="text/javascript"></script> 
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js " language="javascript" type="text/javascript"></script>      
        <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js " language="javascript" type="text/javascript"></script>      
        <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js " language="javascript" type="text/javascript"></script>      
        <script src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.html5.min.js " language="javascript" type="text/javascript"></script>      
        <link href="https://nightly.datatables.net/buttons/css/buttons.dataTables.min.css" rel="Stylesheet" type="text/css" />
    
    $(document).ready(function () { var table = $('#example').DataTable( { dom: 'Bfrtip', buttons: [ 'copy', 'excel', 'pdf' ] } ); });

    Many thanks

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977

    Hey guys, also having the same problem, even with the nightly build.
    Can you advise why the nightly build may not be working?

    Are you getting the corrupt file message? If not what happens?

    Does the export work with other browsers?

    Kevin

  • emmKayemmKay Posts: 5Questions: 1Answers: 0

    Call this crazy but I now have it working with buttons 1.5.2 (not the nightly version) The standard version https://cdn.datatables.net/buttons/1.5.2/js/dataTables.buttons.min.js

    I added a <title>blah</title> tag to my head section and the exports now work.
    If I keep the title blank as such <title></title>, the exports fail.

  • emmKayemmKay Posts: 5Questions: 1Answers: 0
    edited September 2018

    I wasn't able to export at all but I can now that I have the title tag in.
    I have put the nightly files in but I am still getting the corrupt file message.

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977

    I have put the nightly files in but I am still getting the corrupt file message.

    Does your export work with browsers other than IE 11?

    Kevin

This discussion has been closed.