pdf export - cannot customise column widths AND add message
pdf export - cannot customise column widths AND add message
I have set up a pdfHtml5 export and I can either set the column widths OR add a message.
If I try to add both, I get an error Cannot set property 'widths' of undefined
{
extend: 'pdf',
message: 'hello',
text: 'PDF',
pageSize: 'A4',
download: 'open',
orientation: 'landscape',
exportOptions: {
columns: [1,2,4,5,6,7,8]
},
customize : function(doc) {
doc.content[1].table.widths = [ '10%', '12%', '12%', '18%', '28%', '10%', '10%'];
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If you add a message the
doc.content
array is altered. You couldconsole.log( doc.content )
in yourcustomize
method, but I think you'll find that the table is bumped intodoc.contant[2]
.Allan
Perfect. - I got the code snippet from another post.
I understand it now