How can I add a message when export pdf

How can I add a message when export pdf

AngelesGriecoAngelesGrieco Posts: 2Questions: 1Answers: 0

Hi everybody
I need to add a kind of "NO DATA" message in the pdf when there are no rows in the datatable.
I tried adding row in the function:
customize: function (doc)
but is not possible.

extend: 'pdf',
footer: true,
text: '<i class="fa fa-file-pdf-o" title="' + this.localizationService.instant("COMMON.PDF") + '"> </i>',
orientation: 'landscape',
pageSize: 'A4',
exportOptions: {
columns: ':not(.no-export), .only-pdf',
modifier: {
search: 'applied',
order: 'applied'
}
},
title: namePersonalized,
customize: function (doc) {
doc.content.splice(0, 0, {

....

Thanks!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916
    Answer ✓

    This example shows how to place messages in the export. Maybe one of those options will work as a function. The count() API shows an example of testing for an empty table.

    Kevin

  • AngelesGriecoAngelesGrieco Posts: 2Questions: 1Answers: 0

    Hi Kevin thanks a lot!! I tried using messageBottom and it works ok!

This discussion has been closed.