Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81934

EXCEL file export need repairing in IE11

$
0
0

Hello sir, I just wanna ask why this error appears in IE11 and what's the possible solutions am I going to use.
I have a screenshot provided of what is the error. I already searched for the possible solutions in you site and I also tried to use 'excel','excelFlash', 'excelHtml5' but all of them got this error when I download and open the file.
Then this is the my code for now:

  $('#premium_stmt_tbl').dataTable({
      "bDestroy": true,
      "aaSorting": [],
      "iDisplayLength": 20,
      "aLengthMenu": [[20, 40, 60, 80, 100, -1], [20, 40, 60, 80, 100, "All"]],
      "scrollX": true,
      "responsive": true,
      "processing": true,
      "oLanguage": {
        "sSearch": '<div class="input-group">_INPUT_<span class="input-group-addon"><i class="fa fa-search"></i></span></div>',
        "sSearchPlaceholder": "Search...",
        "sProcessing":"Loading Policies..."
      },
      dom: 'B<"col-sm-6"l><"col-sm-6"f>rtip',
      buttons: [
          { extend: 'excel', footer: true },
          { extend: 'pdfHtml5',
            footer: true,
            orientation: 'landscape',
            pageSize: 'LEGAL',
            exportOptions: {
              columns: [0,1,2,3,4,5,6,7,8,9],

            }
          }
      ],
      "columns" : [
            { "width": "100px"},
            { "width": "60px"},
            { "width": "110px"},
            { "width": "110px"},
            { "width": "150px"},
            { "width": "90px", className: "text-center"},
            { "width": "100px", className: "text-center"},
            { "width": "50px", className: "text-right"},
            { "width": "50px", className: "text-right"},
            { "width": "60px", className: "text-right"},
            { "width": "10px"}
      ],
      "footerCallback": function ( row, data, start, end, display ) {
          var api = this.api(), data;

          // Remove the formatting to get integer data for summation
          var intVal = function ( i ) {
              return typeof i === 'string' ?
                  i.replace(/[\$,]/g, '')*1 :
                  typeof i === 'number' ?
                      i : 0;
          };

          // Update footer
          $( api.column( 6 ).footer() ).html(
              '<strong>Total:</strong>'
          );

          // Total over this page
          billedTotal = api
              .column( 7, { page: 'current'} )
              .data()
              .reduce( function (a, b) {
                  return intVal(a) + intVal(b);
              }, 0 );

          // Update footer
          $( api.column( 7 ).footer() ).html('<strong>$'+billedTotal.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+'</strong>');

          cancelledTotal = api
              .column( 8, { page: 'current'} )
              .data()
              .reduce( function (a, b) {
                  return intVal(a) + intVal(b);
              }, 0 );

          // Update footer
          $( api.column( 8 ).footer() ).html('<strong>$'+cancelledTotal.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+'</strong>');

          netdueTotal = api
              .column( 9, { page: 'current'} )
              .data()
              .reduce( function (a, b) {
                  return intVal(a) + intVal(b);
              }, 0 );

          // Update footer
          $( api.column( 9 ).footer() ).html('<strong>$'+netdueTotal.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+'</strong>');
      },
      "serverSide": true,
      "ajax": {
        url : url+"premium-production-list",
        type: 'POST',
        dataFilter: function(data){
          var json = jQuery.parseJSON( data );
          json.recordsTotal = json.recordsFiltered;
          json.recordsFiltered = json.recordsFiltered;
          json.data = json.data;
          return JSON.stringify( json ); // return JSON string
        }
      }
  });

I also use Server-side processing..
Just to be clear, this error only prompts when I open the exported file.
Please guide me on this. Thanks.


Viewing all articles
Browse latest Browse all 81934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>