Header row is not printing using print button ?

Header row is not printing using print button ?

AsifkkhanAsifkkhan Posts: 11Questions: 3Answers: 0
edited February 2020 in Free community support

Hi I am using print button with header row column search. my code is working good but header row not going in print it is not going in pdf too. This is the example jsfiddle link

here is my js code ( Please Help me to find out where i did mistake)

$(document).ready( function () { // Setup - add a text input to each footer cell $('#ContentPlaceHolder1_GridView1 thead tr').clone(true).appendTo( '#ContentPlaceHolder1_GridView1 thead' ); $('#ContentPlaceHolder1_GridView1 thead tr:eq(1) th').each( function (i) { var title = $(this).text(); $(this).html( '' ); $( 'input', this ).on( 'keyup change', function () { if ( table.column(i).search() !== this.value ) { table .column(i) .search( this.value ) .draw(); } } ); } ); var table = $('#ContentPlaceHolder1_GridView1').DataTable({ dom: 'Bfrtip', buttons: [ { extend: 'print', title: '', customize: function ( win ) { $(win.document.body) .css( 'font-size', '10pt' ) .prepend( document.getElementById('ContentPlaceHolder1_lblCompanyNameHeader').innerText + '
Placement Register
' ); $(win.document.body).find( 'table' ) .addClass( 'compact' ) .css( 'font-size', 'inherit' ); } }, 'excelHtml5', 'csvHtml5', 'pdfHtml5' ], "paging": false } );} );

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.