pdf export show only custom footer
pdf export show only custom footer
wildwamqire
Posts: 2Questions: 1Answers: 0
This my problem how to visible default footer my code
`
$(document).ready(function() { var dt = $('#onek').DataTable( { "processing": true, "serverSide": true, "pagingType": "full_numbers", "ajax": "datatable.php?tip=stokdokum", "pageLength": -1, "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tümü"]], "columns": [ { "data": 1}, { "data": 2}, { "data": 3}, { "data": 4}, { "data": 5}, { "data": 6}, ], "dom": 'Blfrtip', "buttons": [ { className: 'btn btn-danger', extend: 'pdf', footer: true , title: 'Stok Dökümü', text: 'PDF Çıktısı Al', filename: function(){ var today = new Date(); var n = today.getDate() + '-' + (today.getMonth() + 1) + '-' + today.getFullYear();; return 'Stok_Dokum_' + n; }, exportOptions: { modifier: { page: 'current'} } } ], "order": [[5, 'desc']], "language": { "url": "assets/Turkish.json" }, "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; }; ////////////////////////////////////////////////// alisTotal = api .column( 3, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); var alis = alisTotal .formatMoney(2, '.', ','); // Update footer $( api.column(3).footer(3)).html( ''+alis +' TL' ), ////////////////////////////////////////////////// satisTotal = api .column( 4, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); var satis = satisTotal .formatMoney(2, '.', ','); // Update footer $( api.column(4).footer(4) ).html( ''+satis+' TL' ), ////////////////////////////////////////////////// stokTotal = api .column(5, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); // Update footer $( api.column(5).footer(5)).html( ''+stokTotal +'' ); } } ); } );`
This discussion has been closed.
Answers
I'm not actually sure either what the problem is or what your question is?
Allan
I want to hide header after first page in exported pdf
I don't believe there is an option for that in the pdfmake library. You'd need to refer to their documentation if there is a way.
Allan