DataTables Export Plugin
Export your grid data to many document. Support doc, xls, pdf, csv, xml, html, and print
Example
var dt = ; // Export to Word Document// On element with id="btn-export" clicked;
Export to other document types
To Word (.doc) $.fn.DataTable.Export.word(dataTable, config)
To Excel (.xml) $.fn.DataTable.Export.excel(dataTable, config)
To CSV (.csv) $.fn.DataTable.Export.csv(dataTable, config)
To PDF (.pdf) $.fn.DataTable.Export.pdf(dataTable, config)
To XML (.xml) $.fn.DataTable.Export.xml(dataTable, config)
To HTML $.fn.DataTable.Export.html(dataTable, config)
To Print $.fn.DataTable.Export.print(dataTable, config)
*) for pdf you must integrate pdfmake plugin (pdfmake.js and vfs_fonts.js)
Config
filename: '...' // document title title: '...' // document description message: '...' // header title header: 'ID' 'Name' '...' // field field: 0 1 4 5 '...' // or field: 'employe_id' 'name' '....' // orientation (pdf and word only) 'orientation' 'landscape' // separator (csv only) 'separator' ',' // for pdf only 'download' 'download' // or 'open' for preview 'pageSize' 'A4'