Exporting Not Working

Exporting Not Working

ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
edited May 2013 in TableTools
Hi,
I have implemented the data table and trying to put the export buttons on the page.iput all the code mentioned in forums and examples.

[code]

..
..
..





$(document).ready( function () {
$('#example').dataTable( {
"bRetrieve" : true,
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "print",
"sButtonText": "Print",
"bShowAll": true,
"sMessage": "Record Data",
},
{
"sExtends": "pdf",
"sButtonText": "Export to PDF"
},
{
"sExtends":"xls",
"sButtonText": "Export for Excel"
}
]}
});
} );

[/code]

Replies

  • kamikskamiks Posts: 2Questions: 0Answers: 0
    [code]"sSwfPath": "http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"[/code]

    Allan mentioned in one thread that you should not point to SWF on datatables.net. Instead use local file for that. Maybe that is the problem?
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    what i use then ???
  • psharppsharp Posts: 39Questions: 0Answers: 0
    /extras/TableTools/media/swf/copy_csv_xls.swf
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    edited May 2013
    i got the file
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    edited May 2013
    Hi,
    i downloaded all the new version.and still give this error
    Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download

    @version 1.9.4
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    Done issue closed
  • rachidienrachidien Posts: 5Questions: 0Answers: 0
    Hi,
    Can you tell me how you resolved this issue. the save option is not working in my code

    here is my instanciation code :
    [code] $(document).ready(function() {
    $('#myTable').dataTable({
    "sDom": "<'row-fluid'<'span4'l><'span3'T><'span5'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
    "oTableTools": {
    "sSwfPath": "js/swf/copy_csv_xls_pdf.swf",
    "aButtons": [
    "copy",
    "print",
    {
    "sExtends": "collection",
    "sButtonText": 'Enregistrer ',
    "aButtons": [ "csv", "xls", "pdf" ]
    }
    ]
    }
    });
    [/code]

    The table displays good and the export dropdown button is showing as in the plugin, but the buttons dont work.

    Any idea ????
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    try with this:
    [code]
    $(document).ready( function () {
    $('#example').dataTable( {
    "bRetrieve":true,
    "sDom": 'T<"clear">tip',
    "oTableTools": {
    "aButtons": [
    {
    "bFooter": true,
    "sExtends": "copy",
    "sButtonText": "Copy",
    "mColumns": [ 1,2,3,4,6,7 ]
    },
    {
    "bFooter": true,
    "sExtends": "print",
    "sButtonText": "Print",
    "mColumns": [ 1,2,3,4,6,7 ]
    },
    {
    "bFooter": true,
    "sExtends": "xls",
    "sButtonText": "XLS",
    "sFileName": "*.xls",
    "mColumns": [ 1,2,3,4,6,7 ]
    },
    {
    "bFooter": true,
    "sExtends": "csv",
    "sButtonText": "CSV",
    "mColumns": [ 1,2,3,4,6,7 ]
    },
    {
    "bFooter": true,
    "sExtends": "pdf",
    "sButtonText": "PDF",
    "mColumns": [ 1,2,3,4,6,7 ]
    }
    ]
    }
    } );
    } );
    [/code]
  • rachidienrachidien Posts: 5Questions: 0Answers: 0
    edited June 2013
    Thanks for your reply.
    I tried your solution. But I still have the same problem, although the copy button works fine, but the other save options (to pdf, xcl, csv) don't do anything

    PS : as I'm using Bootstrap, I use the Dom Definition as below :
    [code]
    "sDom": "<'row-fluid'<'span4'l><'span3'T><'span5'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
    [/code]

    instead of :

    [code]
    "sDom": 'T<"clear">tip',
    [/code]
This discussion has been closed.