volosoft / jtable

A JQuery plugin to create AJAX based CRUD tables.
http://www.jtable.org
1.1k stars 506 forks source link

Exporting JTable data into a pdf. Can anyone help? #1287

Closed rheinzlabzher02 closed 10 years ago

rheinzlabzher02 commented 10 years ago
toolbar: {
items: [{
    icon: '/images/pdf.png',
    text: 'Export to PDF',
    click: function () {
        //perform your custom job...
    }
}]
},

All i was seeing is this piece of code.. Can some help on the server side of this code. What should i do on the "perform your custom job.." i'm quite new to jtable. Thanks a lot. By the way, i'm using PHP. Thank you again

misterparsons commented 10 years ago

Lots of reasons. You need to produce a document with different headers etc. PDFs are generally designed for printing, so you will most likely to require different layouts. You may want more than current jtable page of data printed, or if jtable page is very large, you may want table headers and footers for page brakes. You probably don't want checkboxes or action icons in the printable version. You may well use a different font and style altogether for printing, typically sans serif for screens and serif fonts for printing. The point of the action button would be to implement not only the link, but a selection / setup dialog for the export. Using php to create pdf files is straightforward but very different from generating html. I use the fpdf class downloadable from phpclasses.org Good Luck Malcolm

hikalkan commented 10 years ago

Hi @rheinzlabzher02,

You should use some server-side library for that. jTable is client-side and independed from any server-side technology like PHP. I don't know any library for PHP, since I'm .NET developer :)