Doesn´t show all information to export a large table in pdf with pdfHtml5
Doesn´t show all information to export a large table in pdf with pdfHtml5
Hello everybody.
I have a problem when i try to export a table with 20 columns, only show 17 columns, change orientation and paper size, so you know what happend? this my code
$("#idTablaReporteECMMensajesError").dataTable({
"data": data,
tabla: "#idTablaReporteECMMensajesError",
dom: 'Blfrtip',
buttons:
[{
extend: 'collection',
text: DATBLG,
buttons: [
{
extend: 'excelHtml5',
title: RPRMM,
},
{
extend: 'pdfHtml5',
title: RPRMM,
exportOptions: {
columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,18,19,20]
},
customize: function (doc) {
// Splice the image in after the header, but before the table
console.log('doc.cont', doc.content);
//console.log('doc.cont', doc.content.table);
//console.log('doc.cont', doc.content.body);
var columns= []
for (var i = 0; i < doc.content[1].table.body[0].length; i++) {
columns.push("*");
}
doc.content[1].table.widths = columns;
},
orientation: 'landscape',
pageSize: 'TABLOID'
},
{
extend: 'csvHtml5',
title: RPRMM,
}]
}],
"colVis": {
"showAll": RPTXTALL,
"showNone": RPTXTNOT,
"buttonText": RPTXTMO
},
"order":[[2, "asc"]],
stateSave: true,
"lengthMenu": [500, 1000, 1500],
"scrollY": 250,
"scrollCollapse": true,
"scrollX": true,
"columns": that.columnsReporteECMMensajesMotor,
select: {
style: 'os',
selector: 'tr'
}
});