I'm working on implementing Copy, Excel, PDF, and Print. The first three are working with no issues, but Print is giving me problems. When trying to print, if I click the Print button, then opens the print preview page but no data show on the print preview page. The print preview only shows the title. Here is my code.
$("#task_table_list").DataTable({
dom: "fBrt",
buttons: [
{
extend: 'copy',
text: '<i class=" icon-file-openoffice position-left"></i>',
"className": 'all_button'
},{
extend:'pdf',
text:'<i class="icon-file-pdf position-left"></i>',
"className": 'all_button'
},
{
extend:'csv',
text:'<i class="icon-file-excel position-left"></i>',
"className": 'all_button'
},
{
extend:'print',
text:'<i class="icon-printer position-left"></i>',
"className": 'all_button',
// "autoPrint": false,
exportOptions: {
stripHtml: true
},
exportOptions: {
modifier: {
page: 'current'
}
},
},
]
})
Here is a working example with the same buttons you have.
Before, here are some things to take into consideration: