How to change the display format of the data in a pdf file

How to change the display format of the data in a pdf file

Bilal007Bilal007 Posts: 2Questions: 2Answers: 0

I'm developing an asp.net mvc 5 application in which I've a table of employees on which I've implemented the DataTables.js plugin, data is displaying fine on the web page because datatables.js provides the (responsive : true) capability for the table in order to manage many columns in a table, since datatables is a powerful plugin, it provides the facility to export the table to a pdf file, so that a user can download it, but since my table has many columns, so, when I download that pdf file, half of the columns are displaying and others are omitted, refer to the image below

image.PNG displays the data of 4 employees, and after the (Basic Pay), rest of the data is not displayed. Basically, I want to generate a salary slip for each employee, so, since there are 4 employees, I've to generate 4 salary slips, there will now be 4 pages in the pdf file, there are many columns, so, I cannot arrange them in a horizontal manner (as the above picture says), so I want to assign the whole page to each employee, now I can arrange the rest of the data in a vertical manner, So, is it possible to do so? in other words, if the user clicks the pdf downloadable button, it generates 4 pages in which data is arranged like a pay slip for each employee, just for an example check payslip-template-22.jqg image

payslip-template-22.jpg is an example to how I want to format each employee data in a pdf file, Is it possible? how can I do this?, If it is not possible then what suggestion will you give to get the required result? I can make the question even more clear if it is not clear. Any help is deeply appreciated, Thanks in Advance :smile:

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin
    Answer ✓

    It is possible, but I suspect it wont be trivial. pdfmake is the library that Buttons uses for the PDF export. You can customise the PDF output using the customize option of the pdfHtml5 button type, although I suspect in this case you would be better just creating your own button that will create the pdf using a function you'd need to write that interfaces with the pdfmake API.

    Allan

This discussion has been closed.