Do we need webserver for TableTools to work

Do we need webserver for TableTools to work

nitinyadavnitinyadav Posts: 3Questions: 0Answers: 0
edited August 2012 in General
I was trying to add the download as excel and csv feature, but its not working. It fails with error : uncaught exception: Unable to load SWF file - please check the SWF path in Tabletools.js
I was wondering do we need to host it on tomcat or some other server for it to work or just adding the files in a common folder will make it work.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    You can use the Flash control panel to set a security exception if you want to use it on your local file system: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html .

    However, that isn't the error that I would expect you to get if you were using it on the local file system. I'd suggest having a look at the Firebug or Webkit console to see what is happening (i.e. where it is trying to load the data from).

    Allan
  • nitinyadavnitinyadav Posts: 3Questions: 0Answers: 0
    Thanks allan, i tried debugging from console. I get the error in ZeroClipboard.js:

    Line: 134 has error

    this.div.innerHTML = this.getHTML( box.width, box.height );
    this.loadingTimer = setTimeout( function () {
    throw( 'Unable to load SWF file - please check the SWF path' );
    Uncaught Unable to load SWF file - please check the SWF path (repeated 2 times)
    }, 10000 )

    but i have supplied the path as correct.
    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
    "oTableTools": {
    "sSwfPath": "copy_csv_xls_pdf.swf",
    "aButtons":["copy", "print","xls"]
    }
    } );
    } );

    where the swf and html file both are in same folder.
    I have also tried setting the absolute path:
    "sSwfPath": "C:/Users/Username/Desktop/copy_csv_xls_pdf.swf",

    but still the table features work like sorting and searching but the download is not working.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Can you update to the latest version of TableTools please? That code has been updated since then. Are you using 2.0.x?

    Allan
  • nitinyadavnitinyadav Posts: 3Questions: 0Answers: 0
    Hey Allan, i was able to resolve the issue by running the code through apache web-server. When i open the file directly in browser then export button doesn't result in any result. But when i open same page through apache then the export option worked successfully.
    I downloaded 1.9 as it was a stable release shown on website. I will try it with 2.x too.
    Thanks :)
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    > When i open the file directly in browser then export button doesn't result in any result. But when i open same page through apache then the export option worked successfully.

    That is a security feature of Flash. You can add an exception to your Flash player here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

    Allan
This discussion has been closed.