Problem in tabletools PDF export!

Problem in tabletools PDF export!

mhsmhs Posts: 2Questions: 0Answers: 0
edited May 2012 in TableTools
Hi,
I've got the Datatables working on my site but I found there is an issue in Tabletools PDF generator:
When I click on PDF button, Tabletools just export the table title, no thing more!
[code]
function formatTime(value) {
var buf = [];
buf.push(String(Math.floor(value/3600)));
buf.push(':');
var x=value%3600;
if(x/60 < 10)
buf.push('0');
buf.push(String(Math.floor(x/60)));
buf.push('\'');
if(x%60 < 10)
buf.push('0');
buf.push(String(x%60));
buf.push('\"');
return buf.join("");
};
$(document).ready( function () {
$('#dynamic').html( '' );
var oTable = $('#example').dataTable({
"sDom": 'T<"clear">lfrtip',
"aaSorting": [],
"oTableTools": {
"sSwfPath": "swf/copy_cvs_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [
"copy",
"csv",
"xls",
{
"sExtends": "pdf",
"sPdfOrientation": "portrait",
"sPdfMessage": "PhoneLogger call details"
},
"print","select_all", "select_none"
]
},
// "aaData": aDataSet,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": 'detail.json',//'/cgi-bin/phlog.cgi?id=l',//
"sServerMethod": "POST",
"aoColumns": [
{ "sTitle": "Name" },
{ "sTitle": "ID" , "sClass": "center"},
{ "sTitle": "No." },
{ "sTitle": "Date & Time" , "sClass": "center"},
{
"sTitle": "Duration",
"sClass": "center",
"fnRender": function(obj) {
var sReturn = parseInt(obj.aData[ obj.iDataColumn ],10);
return formatTime(sReturn);
}
}
],
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "IndexRec", "value": 0xffff } );
aoData.push( { "name": "IndexCounter", "value": 0 } );
$.post(sSource, aoData,function (json) {
fnCallback(json)
}, "json" );
}
} );
new FixedHeader( oTable );
} );
[/code]
I have tried DataTables Ver. 1.9.1 and Ver. 1.9.0 and both work as mentioned, but when I try this code by V1.8, it works well and all of data shown in PDF file.
For simplicity I wrote server response in a file to be checked without the need to server:
[code]
{"aaData":[
["Eric Smith ","003","66509296 ","11/07/2010 10:01","012"],
["Jack ","002","45645643 ","11/07/2010 10:02","022"],
[" ","003","8768752 ","11/07/2010 10:03","211"],
["Not Specified ","013","87767853 ","11/07/2010 10:04","045"],
["John Smith ","006","09122088395","11/07/2010 10:05","078"],
["Eric ","004","66505447 ","11/07/2010 10:06","004"],
["Eve ","003","76576884 ","11/07/2010 10:07","023"]

]}
[/code]

Any help appreciated.

Replies

  • mhsmhs Posts: 2Questions: 0Answers: 0
    It seems that problem solved in version 1.9.1 and Tabletools works well (by changing swf name to copy_csv_xls_pdf.swf for use in 1.9.1) but now another issue in DT 1.9.1:
    Button graphics (ie. csv.png, csv_hover.png, ...) were not shown!
    Is it optional to use graphics instead of text labels for them? If so, what is that option?
This discussion has been closed.