1
Hello, I have a system in which, on one of your pages, I display the data that comes from a database table. Since to make this view I use the Datatables plugin.
The problem is that when I try to print (through the button created by Datatables itself) or try to export by PDF or Excel, only the current page (that I am), is printed. I would like you to print all pages that are available in the pagination.
You know if this is possible ?
Below is the code used in Datatables:
$('#resultado-relatorios-divisao-empresas-por-responsavel').DataTable({
dom: 'Bfrtip',
buttons: [
//botão para salvar em pdf
{
extend: 'pdfHtml5',
text: 'Salvar em PDF',
orientation: 'landscape',
exportOptions: {
modifier: {
page: 'current'
}
}
},
//botão para salvar em excel
{
extend: 'excelHtml5',
text: 'Gerar Excel',
orientation: 'landscape',
exportOptions: {
modifier: {
page: 'current'
}
}
},
//botão para imprimir
{
extend: 'print',
text: 'Imprimir',
orientation: 'landscape',
exportOptions: {
modifier: {
page: 'current'
}
}
}
],
paging: true,
scrollX: true,
scrollCollapse: true,
scrollY: "400px",
"language": {
"lengthMenu": "Mostrando _MENU_ registros por página",
"zeroRecords": "Nenhum registro encontrado com estes parâmetros de pesquisa",
"info": "Mostrando página _PAGE_ de _PAGES_",
"infoEmpty": "Nenhum registro disponível",
"infoFiltered": "(filtrado de _MAX_ registros no total)",
"search": "Pesquisar:",
"paginate": {
"first": "Primeiro",
"last": "Último",
"next": "Próximo",
"previous": "Anterior"
},
},
"language": {
"lengthMenu": "Mostrando _MENU_ registros por página",
"zeroRecords": "Nenhum registro encontrado com estes parâmetros de pesquisa",
"info": "Mostrando página _PAGE_ de _PAGES_",
"infoEmpty": "Nenhum registro disponível",
"infoFiltered": "(filtrado de _MAX_ registros no total)",
"search": "Pesquisar:",
"paginate": {
"first": "Primeiro",
"last": "Último",
"next": "Próximo",
"previous": "Anterior"
},
},
"processing": true,
"serverSide": true,
"ajax": {
"url": "../banco/banco-vision/pagina-relatorios-divisao-empresas-por-responsavel/php-arquivos-disponiveis.php",
"type": "POST",
"data": function(item) {
item.empresa_origem = $('#empresa_origem_relatorio').val();
item.departamento = $('#departamento_relatorio').val();
item.responsavel = $('#responsavel_relatorio').val();
item.cod = $('#cod_relatorio').val();
item.empresa = $('#empresa_relatorio').val();
//item.atividade = $('#atividade_relatorio').val();
}
},
});
Below is the system image:
Another thing is that when I put these buttons below (marked in red):
... Automatically it removes this button below (marked in red):
Could you help me ?
Please provide additional details in your reply. As it is currently written, it is difficult to understand your solution.
–