Datatable Tool options - Excel,CSV,PDF and Copy is not working?

Datatable Tool options - Excel,CSV,PDF and Copy is not working?

KarthickeyanKarthickeyan Posts: 2Questions: 1Answers: 0

I downloaded dataTables.tableTools.js and trying to run it, but Excel,CSV,PDF and Copy is not working only print option is working,I followed all steps given in document.

I could see the mouse pointer changing on hover.

$('#_dynamicReportTable').dataTable({ "autoWidth": false, "bInfo": false, paging: false,
"dom": 'T<"clear">lfrtip',
"tableTools": {
"aButtons": ["print", "csv"],
"sSwfPath": window.location.protocol + "//" + window.location.host + "/_layouts/TimeSheet/js/ui/supportFiles/copy_cvs_xls_pdf.swf"
}
});

Answers

  • goldygoldy Posts: 20Questions: 11Answers: 0

    is that from your header?

  • KarthickeyanKarthickeyan Posts: 2Questions: 1Answers: 0
    edited May 2014

    What do you mean?

    $("#_dynamicReportContainer").empty();
    var tableDefinition = "<table id='_dynamicReportTable'><thead><tr>";
    
    // do some updates here...
    
    tableDefinition = tableDefinition.concat('</tr></thead></table>');
    $('#_dynamicReportContainer').append(tableDefinition);
    var table = $('#_dynamicReportContainer').children();
    
    // do some updates here...
    
    reportData.each(function (k, v) {
           table.append("<tr><td>" + startDate + "</td><td>" + queryStringSecondary + "</td><td>" + k + "</td><td>" + v + "</td></tr>");
    });
    
    // do some updates here...
    
    $('#_dynamicReportTable').dataTable({ "autoWidth": false, "bInfo": false, paging: false,
        "dom": 'T<"clear">lfrtip',
        "tableTools": {
            "aButtons": ["print", "csv"],
            "sSwfPath": window.location.protocol + "//" + window.location.host + "/_layouts/TimeSheet/js/ui/supportFiles/copy_cvs_xls_pdf.swf"
        }
    });
    

    I could see the data on the table(datatable) and could print however other options(Excel,CSV...) are not working.

  • goldygoldy Posts: 20Questions: 11Answers: 0

    Hmm.. I'm not sure why yours isn't working sorry.. I see your abuttons are print,csv, i have similiar statements and mine works without issue.

This discussion has been closed.