PDF CSV EXCEL not working in IE11

PDF CSV EXCEL not working in IE11

senthilkumardsenthilkumard Posts: 3Questions: 0Answers: 0
edited March 2019 in Free community support

Error

SCRIPT1010: Expected identifier
pdfmake.min.js (2,605)

While loading itself getting script error in Internet Explorer 11.

IMPORT

<link rel="stylesheet" href="/css/buttons.dataTables.min.css" />
<link rel="stylesheet" href="/css/jquery.dataTables.min.css" />
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet" href="/css/jquery-confirm.min.css" />














CODE :

$("#report").DataTable( {
destroy: true,
responsive: true,
"sAjaxSource": "./ReportDataServlet?"+formData,
"bJQueryUI": true,
"scrollY": 400,
"scrollX": true, // enables horizontal scrolling
"aoColumns": my_columns,
dom: 'lfrtip <"bottom"B>',
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"tableTools": {
"sSwfPath": "/swf/copy_csv_xls_pdf.swf"
}
/* buttons: [
{
extend: 'colvis',
collectionLayout: 'fixed two-column'
},
'pdf','copy', 'csv', 'excel','print'

                        ] */

// dom: 'Bfrtip',

            } ); 

Replies

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765

    Looks like you are trying to use both Tabletools which is retired and buttons. Buttons is the replacement for Tabletools so they might be conflicting. Try removing Tabletools. Also you didn't post the JS include files, maybe you are loading them in the incorrect order. you can use the Download Builder to get the correct order.

    If this doesn't help please post a link to your page or a test case replicating the issue for help with debugging.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • senthilkumardsenthilkumard Posts: 3Questions: 0Answers: 0
    edited March 2019

    Even i tried with buttons same error occurs.
    SCRIPT1010: Expected identifier
    pdfmake.min.js (2,605)

    This is my order

    jquery-3.3.1.js
    jquery-1.8.3.js
    jquery.dataTables.min.js
    dataTables.buttons.min.js
    buttons.flash.min.js
    jszip.min.js
    pdfmake.min.js
    vfs_fonts.js
    buttons.html5.min.js
    buttons.print.min.js
    buttons.colVis.min.js
    bootstrap.min.js
    bootstrap-datepicker.min.js
    jquery-confirm.min.js

    var formData = $("[name='reportsForm']").serialize();
    var indexCnt = 1;
    $("#dt").show();
    $.ajax({
    url:"ReportDataServlet?&actionId=4&LAST_COUNT=1",
    type:'post',
    data: formData,
    dataType: 'json',
    cache: false,
    success: function(data) {
    $("#dt").show();
    colLength = data.length;
    if(colLength !=0 && ((colLength >= 7 && colLength < 12)) ){
    orientation = "landscape";
    pageSize = 'LEGAL';
    }else if(colLength >= 12 && colLength < 18){
    orientation = "landscape";
    pageSize = 'A2';
    }else if(colLength >= 18){
    orientation = "landscape";
    pageSize = 'A1';
    }else{
    orientation = "portrait";
    pageSize = 'LEGAL';
    }
    $.each(data, function(index, column) {
    var obj = {"mData":column.mData,"title":column.title,defaultContent:""};//{ mData sTitle: key };
    my_columns[index] = obj;
    indexCnt ++;
    });
    $("#report").DataTable( {
    destroy: true,
    responsive: true,
    "sAjaxSource": "./ReportDataServlet?"+formData,
    "bJQueryUI": true,
    "scrollY": 400,
    "scrollX": true, // enables horizontal scrolling
    "aoColumns": my_columns,
    dom: 'lfrtip <"bottom"B>',
    "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],

                         buttons: [
                            {
                               extend: 'colvis',
                               collectionLayout: 'fixed two-column'
                           },
                                     'pdf','copy', 'csv', 'excel','print'
    
                            ] 
    

    // dom: 'Bfrtip',

                } ); 
            }
           });
    
  • senthilkumardsenthilkumard Posts: 3Questions: 0Answers: 0
    edited March 2019

    Am simply import this one alone getting script error in IE11

    <html>
    <head>

    <title>Reports</title>

    </html>

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394
    edited March 2019

    jquery-3.3.1.js
    jquery-1.8.3.js

    You are loading two different versions of jQuery.

    Otherwise, please see Kevin's post about providing a link to your page.

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    pdfmake throws an error in legacy browser's that don't support its APIs. I've reported that as an issue to them.

    Allan

This discussion has been closed.