Excel button showing on localhost only

Excel button showing on localhost only

lancewlancew Posts: 10Questions: 3Answers: 0
edited July 2017 in Free community support

I have the excel button setup and working on my localhost but when I copy the site contents to the server the button doesn't appear. When I use the Chrome dev tools network tab I see a call to the datatables cdn for the swf file. When I run the site on the server the call is not made. There are no Javascript errors and I am using the same client and browser.
Any ideas?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948

    call to the datatables cdn for the swf file.

    Sounds like you are using TableTools. It has been retired in favor of the Buttons extension.

    Kevin

  • lancewlancew Posts: 10Questions: 3Answers: 0

    This is my code.
    $(function () {
    $('#AdminGrid').DataTable({
    "paging": false,
    dom: 'Bfrtip',
    fixedHeader: {
    header: true,
    headerOffset: 50
    //footer: true
    },
    buttons: [
    {
    extend: 'excel',
    text: 'Save as excel',
    exportOptions: {
    modifier: {
    page: 'current'
    }
    }
    }]
    });
    });

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948

    The above code good. Probably will need to see the relevant parts of your HTML code to see what CSS and JS you are including. Can you provide a link to the page with the issue?

    Kevin

  • allanallan Posts: 63,480Questions: 1Answers: 10,467 Site admin

    Have you allowed Chrome to use Flash on your production server? It should typically show a "Click to enable Flash" button or similar.

    Having said that, as I understand it, Flash support will be more or less removed from all browsers in future. Indeed, I plan to stop development of the Flash buttons in future.

    I would strongly suggest that you use the HTML5 export buttons for Buttons rather than the Flash ones.

    Allan

  • lancewlancew Posts: 10Questions: 3Answers: 0
    edited July 2017

    The browser is on a client pc and not the server. I thought the html 5 button were working as a fallback anyway.

    So I now an trying to use the html 5 buttons now and the other buttons work but not excel.

            buttons: [
                'copyHtml5',
                'excelHtml5',
                'csvHtml5',
                'pdfHtml5'
            ]
    

    I am including the Scripts/DataTables/buttons.html5.js file.
    Chrome dev tools show the js file included.

  • allanallan Posts: 63,480Questions: 1Answers: 10,467 Site admin
    Answer ✓

    Have you included JSZip on your page, which is required for excelHtml5?

    Allan

  • lancewlancew Posts: 10Questions: 3Answers: 0

    Yeah that was the missing file.
    So now with the HTML 5 buttons it works local and on the server.
    Thanks

This discussion has been closed.