I have added the following pdf options to jQuery DataTables – the page runs; the pdf gets created; but the options (landscape and message text) don’t take effect.
$('#dataTable').dataTable({
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables_'+window.location.pathname, JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
return JSON.parse( localStorage.getItem('DataTables_'+window.location.pathname) );
},
"sDom": 'CT<"clear">lfrtip',
"oColVis": {
"buttonText": "Show/Hide",
"aiExclude": [ 0 ],
"bRestore": true,
"sAlign": "left"
},
"oTableTools": {
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "Excel",
"mColumns": "visible"
},
{
"sExtends": "pdf",
"sPdfOrientation": "landscape",
"sPdfMessage": "Service Request System",
"mColumns": "visible"
}
],
"sSwfPath": "/swf/copy_cvs_xls_pdf.swf"
}
I had a similar issue with the landscape option not working, but increasing the page size made it to work
"sExtends": "pdf","sPdfSize": "A3".