-1

im using datatables for my front end requirements and it works good except im having an issue in exporting stuff e.g. copy, csv, excel and pdf, only print is working. Any ideas, clues, thoughts, help, suggestions, recommendation? I'm using version 1.10.6

I did link all the necessary libraries e.g. datatables js, css and datatables tools js. Below is my code for activating it on my script

$('#cigptable').DataTable( {
            "pagingType": "full_numbers",
            "dom": 'T<"clear">lfrtip',
            "tableTools": {
                "sSwfPath": "../../../plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
            },
            "oLanguage": {
            "oPaginate": {
              "sPrevious": '<i class="ion-ios-arrow-left"></i>',
              "sNext": '<i class="ion-ios-arrow-right"></i>'
            }
          }
}); 
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
Juliver Galleto
  • 8,831
  • 27
  • 86
  • 164
  • possible duplicate of [jQuery dataTables - TableTools not working](http://stackoverflow.com/questions/24837595/jquery-datatables-tabletools-not-working) – davidkonrad Jul 03 '15 at 05:13
  • This question has answers [here](http://stackoverflow.com/q/24837595/1407478), [here](http://stackoverflow.com/q/23222554/1407478), [here](http://stackoverflow.com/q/25536782/1407478), [here](http://stackoverflow.com/q/18513430/1407478), [here](http://stackoverflow.com/q/29877651/1407478) and a lot more, also this is answered in comments dozen of times and is very well explained in the dataTables documentation and by examples. – davidkonrad Jul 03 '15 at 05:22

1 Answers1

0

See sSwfPath option documentation, below is an excerpt:

sSwfPath Define the path of the SWF to be used by TableTools for copy to clipboard and saving a file locally operations. If you are having problems with these operations, but not printing, this is very likely to be the issue.

Most likely the problem is because of the incorrect path to the copy_csv_xls_pdf.swf file. Try to use CDN link instead:

//cdn.datatables.net/tabletools/2.2.4/swf/copy_csv_xls_pdf.swf

Quoting Allan Jardine, developer of DataTables:

Also, it won't work from a local drive, unless you have a security exception set up for Flash. You can change the Global Security Settings here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html.

Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185