Internet Explorer 11 Print Issue: IE 11 Browser crashes when we try to Print thru DataTable Print
Internet Explorer 11 Print Issue: IE 11 Browser crashes when we try to Print thru DataTable Print
We have default IE 11 Browser and Citrix Environment to access our application.
When we click on Print Button then it opens in new Tab. If we cancel or Print then IE 11 Browser crashes and following is the error message "IE has stopped working. Windows can try to restart the program."
Please note, this happens sporadically/often but not all the time.
Currently, we have below code:
<
script src="https://cdn.datatables.net/buttons/1.1.0/js/buttons.html5.min.js">
<
script src="https://cdn.datatables.net/buttons/1.1.0/js/buttons.print.min.js">
buttons:
[
{
extend: "copy",
className: "btn-primary btn-trans waves-effect waves-green w-md m-b-5",
exportOptions: { columns: ':visible' },
}, // end copy button
{
extend: 'csv',
className: 'btn-primary btn-trans waves-effect waves-primary w-md m-b-5',
title: 'Prep 1',
exportOptions: { columns: ':visible' },
}, // end csv button
{
extend: 'print',
className: "btn-primary btn-trans waves-effect waves-primary w-md m-b-5",
title: 'Prep 1',
// autoPrint: false,
exportOptions: { columns: ':visible' },
customize: function ( win )
{
var apphost = location.protocol + '//' + location.host;
var imgpath = '<img src="' + apphost + '/assets/images/KitchenSync-Logo-Green.png" width="300px" style="position:absolute; top:0; left:0;" />';
$(win.document.body).prepend(imgpath);
$(win.document.body).find('h1').addClass('h1m').css('margin-top', '100px');
$(win.document.body).find('tr td').addClass('printfont').css('font-size', '9px');
$(win.document.body).find('tr td').addClass('printfontcolor').css('color', '#000000');
$(win.document.body).find('tr td').addClass('printtd').css('border-top', '1px solid #ccc');
$(win.document.body).find('tr td').addClass('printtd').css('padding-top', '0px');
$(win.document.body).find('tr').addClass('printtd').css('padding-top', '0px');
$(win.document.body).find('thead tr:first-child').addClass('printtd').css('padding-top', '0px');
$(win.document.body).find('table').addClass('printtd').css('border-collapse', 'collapse');
$(win.document.body).find('th:nth-child(5)').addClass('printtd').css('border-right', '6px solid #ccc');
$(win.document.body).find('td:nth-child(5)').addClass('printtd').css('border-right', '6px solid #ccc');
$(win.document.body).find('tr:nth-child(odd) td').each(function(index)
{
$(this).css('background-color','#D0D0D0');
});
} // end print button customize
} // end print button
], // e