Printing two tables with single button press at a time

Printing two tables with single button press at a time

Khalid TeliKhalid Teli Posts: 251Questions: 71Answers: 0

Hi
I managed to print two tables with a single print button. please have a look at the example in the link

live.datatables.net/pirelabi/1/edit?html,css,js,console,output
It works fine and does the job for me. I tried to do the same with pdf button it is not working,

it shows me the error _pdfMake is not defined. I know I have to define the pdf make function but I don't know how to do that , I started looking the button code here (in the link below) but not sure how and where to define the pdfmake function.

Please help
Thank you
https://github.com/DataTables/Buttons/blob/4bd57cdb229606e0a2d8366ad11f5612d73433fa/js/buttons.html5.js#L51

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    edited December 2020

    This thread would be a good place to start. It using customizeData to get the data from the server to use for the export. You could do something similar, where you get the data from the tables on the page.

    This also has the benefit of working with all export types.

    Colin

This discussion has been closed.