Table tools v2 copy/xls/csv/pdf dont work

Table tools v2 copy/xls/csv/pdf dont work

bocodebocode Posts: 9Questions: 0Answers: 0
edited January 2011 in TableTools
Hi I just downloaded the table tools v 2 and followed all the documentation to plug it/customize it on my site. Unfortunately only the print button is working and the other 4 buttons are not working. I looked in firefox error console
and i see the following error:

Error: uncaught exception: Unable to load SWF file - please check the SWF path

and am getting this error as well:

b is null
Source File: http://localhost/shlk/js/jquery.dataTables.min.js
Line: 61

I looked at the datatables website and buttons there work properly when accessed from my browser (i can save pdf, csv, xls, and copy to clipboard).

Any ideas?
Bo
«134

Replies

  • 4giedrius4giedrius Posts: 7Questions: 0Answers: 0
    Set path to .swf file.

    [code] "oTableTools": {
    "sSwfPath" : "media/swf/copy_cvs_xls.swf"
    }[/code]
  • bocodebocode Posts: 9Questions: 0Answers: 0
    Hi 4giedrius,

    This is a given, and i did set this path before i started using TT. BTW the problem is coming from tabletools.js file from the zeroclipboard code. I copied ZeroClipboard.swf in all the places i can think of but still it does not seem to work.

    Only print preview is working rest of the buttons dont.

    am lost for any logical explanation :-(
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    It is as 4giedrius suggests I think :-). You mentioned ZeroClipboard.swf, but the default TableTools 2 files are called copy_cvs_xls.swf and copy_cvs_xls_pdf.swf. What SWF path are you using? Is it relative or absolute?

    Allan
  • bocodebocode Posts: 9Questions: 0Answers: 0
    Hi Allan,

    I've set the path of copy_cvs_xls_pdf.swf properly and that does not seem to pose any problem. I'm referring to this piece of code in TableTools.min.js


    var ZeroClipboard={version:"1.0.4-mod",clients:{},moviePath:"ZeroClipboard.swf",


    The path i set in my tabletools initialization code is as follows:


    "oTableTools": {
    "sSwfPath": "/abc/swf/copy_cvs_xls_pdf.swf",
    "aButtons": [ "copy", "csv", "print" ]
    },


    The path, as you can i see, is absolute and it is reachable.

    Thank you
    Bo
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    As you can see in this example ( http://datatables.net/release-datatables/extras/TableTools/swf_path.html ) that should be all that is needed. Could you give me a link to the page please, so I can see what might be happening? You can send it to http://datatables.net/contact if you don't want to make it public.

    Allan
  • bocodebocode Posts: 9Questions: 0Answers: 0
    Allan,

    Thank you very much for offering to help. The website is on the intranet and is not accessible from outside.

    However, i wanted this to work very badly so i searched for older version of table tools and i got it from this website: http://www6b.wittenberg.edu/lib/include/jquery/dataTables-1.6/extras/TableTools/

    And it is working as expected except that there is no PDF export.

    One thing i fail to understand is why does new TT version refer to ZeroclipBoard.swf when all it needs is either copy_xls_csv.swf (or the pdf version)?

    Regards,
    Bo
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    The ZeroClipboard.js file does refer to ZeroclipBoard.swf you are right - but that's effectively redundant, as TableTools will always instruct ZeroClipboard to look else where for the SWF.

    PDF export is something that was new in TableTools 2 - so you would need to use that if you want PDF export.

    If you have Chrome around or Safari have a look at the inspector's console, it will tell you if there are any 404 errors. Likewise have a look at your server logs for 404 errors.

    Allan
  • n.pirlotn.pirlot Posts: 2Questions: 0Answers: 0
    Good evening,

    Firstly, I would like to express my gratitude for such great add-ons.

    Now, I am having very similar issues, and in ways trying to fix this, have found:
    1. the bundle of all extras with DataTables contains obsolete versions (in particular of TableTools)
    2. all paths work fine, all checked with consoles, only I have a feeling there is an issue with the files contained into the 'as3' directory, is that a likelyhood? does this directory, as well as the 'docs' directory have an impact on the functionning of TableTools?

    Many thanks & kind regards to all.
    Nic
  • n.pirlotn.pirlot Posts: 2Questions: 0Answers: 0
    edited February 2011
    I have tried everything I could think of... relocated qll files to match the samples, used the same links.. and tried removing all the unnecessary scripts & libraries... Basically Chrome gives me a momentary freeze and crash, and Firefox does not respond at all... (just installed the latest version of Firefox + Flash)

    Any help or advice would be greatly appreciated... I spent my whole evening attempting to figure it out :S

    PS: actually, I am having exactly the problem described in: TableTools: tableTools2 example doesn't work in firefox, but only in IE (forums)
  • gowrigowri Posts: 7Questions: 1Answers: 0
    edited May 2011
    I had the same issue when i fix sSwfPath all works fain
    Thanks Allan

    But I have another issue


    When i am using [b]Table tools[\b] , the bJQueryUI is not working .. the jquery ui theme is not applying to Data tables

    My Table Configuration
    ====================

    [code]
    var oTable = $('#user_table').dataTable( {
    "aoColumns": [
    { "sClass": "number", "bSortable": false },
    { "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false },{ "sClass": "nonedit", "bSortable": false }

    ],
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "../js/DataTables/media/swf/copy_cvs_xls_pdf.swf",
    "aButtons": [
    "copy",
    "csv",
    "xls",
    {
    "sExtends": "pdf",
    "sPdfOrientation": "landscape",
    "sPdfMessage": "Your custom message would go here."
    },
    "print"
    ]
    },
    "bProcessing": true,
    "bServerSide": true,
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",

    "sAjaxSource": 'ajax_userreport_table?custom_field=a:14:{i:0;s:9:"user_name";i:1;s:15:"user_first_name";i:2;s:14:"user_last_name";i:3;s:13:"user_password";i:4;s:10:"user_email";i:5;s:11:"user_gender";i:6;s:10:"user_phone";i:7;s:8:"user_dob";i:8;s:12:"user_address";i:9;s:12:"user_country";i:10;s:10:"user_state";i:11;s:9:"user_city";i:12;s:12:"user_zipcode";i:13;s:13:"user_reg_date";}'

    });

    [\code]
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    You need to alter your sDom ( http://datatables.net/usage/options#sDom ) from:

    [code]
    "sDom": 'T<"clear">lfrtip',
    [/code]
    to
    [code]
    "sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
    [/code]
    Allan
  • gowrigowri Posts: 7Questions: 1Answers: 0
    Thanks you so much Allan you always great .That works i am always your fan
  • newbietonienewbietonie Posts: 3Questions: 0Answers: 0
    Hi bocode,

    We have the same problem as yours! And I contacted Allan for help. The solution is that try to test and upload it on your web-server and it won't work from the file system (i.e. file://) as Allan said that there are some security settings in Flash, and that is why it is not working. Print button is working because it is not part of the Flash at all.

    Btw, Thanks Allan for the help! :)
  • s8472s8472 Posts: 1Questions: 0Answers: 0
    I had same problem too and I didn't get the 404 error message.
    The problem was that I was hiding my datatable so all offset values were 0. So my all embed width and height were 0.
    I hope it helps
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    edited September 2011
    I downloaded DataTables-1.8.2

    navigated to DataTables-1.8.2\extras\TableTools
    The Flash Buttons don't work and I have the Latest Version of Flash.

    I click on the buttons and nothing happens.



    Thanks
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Is the swf path correct for your installation? Have a look in your server error log for 404 errors.

    Allan
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    I downloaded DataTables-1.8.2

    navigated to DataTables-1.8.2\extras\TableTools
    The Flash Buttons don't work and I have the Latest Version of Flash.

    I clicked on the buttons and nothing happens.

    I tried this in Firefox and IE.
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    edited September 2011
    I added

    [code]
    "oTableTools": {
    "sSwfPath": "http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf"}
    [/code]

    It Still doesn't work.

    It works fine here http://datatables.net/extras/tabletools/
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    You don't want to pull the SWF (or indeed any other file) off the datatables.net site, since it is not a CDN, and Flash has some XSS protection. You want to put in your own server's address.

    Allan
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    Allan

    I changed the path to see if it would work like it does on your site. I cannot get this work and all the code is the same.
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Can you give us the link please?

    Allan
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    Allan

    I downloaded DataTables-1.8.2 from your Website. Extracted the zip file to my Local C Drive

    Navigated to C:\DataTables-1.8.2\extras\TableTools2

    Click on index.html and tried to click on Copy, CSV, Exce, and PDF nothing happens. When I click on The Print button highlights and It comes up in print preview.
  • bugreportbugreport Posts: 10Questions: 0Answers: 0
    same problem here
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    It won't work from a local drive, unless you have a security exception set up for Flash. This is a Flash security setting, and there is no way for me to get around it I'm afraid. You can change the security settings here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html .

    A better solution is just to dump the files onto a web-server.

    Allan
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    I copied the SWF files to my local server and it works now....
    Thank you for the Explanation.
  • MemeDeveloperMemeDeveloper Posts: 5Questions: 0Answers: 0
    Firstly to Allan and all the other who work on this fantastic stuff - thanks a million, amazing stuff, love it !

    I had same issue - with flash buttons not working.

    I had no 404, and if I used the path directly in the browser I got the flash swf fine.

    so I was very ????

    But as per @s8472 (I think) my problem was not about paths, nor about IIS / asp.net routing failing to serve the request properly (as I had issues with before on another system), but it was simply that I had hidden the buttons with css (and had some Jquery to show them when user wanted to export...)

    I had following css

    [code]
    .DTTT_container {
    display: none;
    }
    [/code]

    Which was problem. Removing this and everything is hunkey dorey ! :)

    Thanks all.
  • dshapirodshapiro Posts: 13Questions: 0Answers: 0
    Sorry, so what is the fix for this issue? I have the same problem where the swf buttons show, but clicking on them makes them all vanish accept for the Print button, which pops up preview mode. I want to have the users have the cvs option.

    The code so far:

    [code]
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">





    @import "/media/css/demo_page.css";
    @import "/media/css/demo_table.css";
    @import "/css/jquery-ui/css/redmond/jquery-ui-1.8.4.custom.css";
    @import "/TableTools/media/css/TableTools.css";

    a { font-family: Arial, Verdana, sans-serif; font-size: 18px; color: #483D8B; text-decoration: none }
    a:hover { font-family: Arial, Verdana, sans-serif; font-size: 18px; color: #A52A2A; background-color: #FAEBD7}
    h1 { font-family: Arial, Verdana, sans-serif; font-size: 32px; color: #A52A2A }
    h2 { font-family: Arial, Verdana, sans-serif; font-size: 24px; color: #A52A2A }





    PERC Entity Location Report


    $(document).ready(function() {

    var oTable = $('#percloc3').dataTable({
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/TableTools/media/swf/copy_cvs_xls_pdf.swf",
    }
    });
    new FixedHeader( oTable );
    });



    This displays the buttons, but if you move the mouse over them they vanish, leaving just the Print option. If I add an aButton for just xls, then no buttons appears.
    [/code]
  • dshapirodshapiro Posts: 13Questions: 0Answers: 0
    Please note that the swf is located on our apache2 server in a subdirectory of htdocs called TableTools, so I think that satisifies the comment above to not run it local.
  • dshapirodshapiro Posts: 13Questions: 0Answers: 0
    Another note is that if I go and pull up /TableTools/index.html with its example, it works. Other than using sSwfPath and new FixedHeader ( oTable ), I think my stuff is the same now (switched to try TableTools.js just like the index.html that comes with TableTools.
  • dvnandoverdvnandover Posts: 42Questions: 0Answers: 0
    edited November 2011
    i on the other hand have a slightly different problem. Everytime the table loaded with data i got the following error:
    Microsoft JScript runtime error: Object required

    and the code stopped at the function below:

    function __flash__addCallback(instance, name) {
    instance[name] = function () {
    return eval(instance.CallFunction("" + __flash__argumentsToXML(arguments,0) + ""));
    }
    }

    Can some expert help?

    Edit: Everything worked fine when the table load the fist time but error out everytime after the first time.

    @dshapiro:
    1. Maybe your sSwfPath is wrong and it should be "TableTools/media/swf/copy_cvs_xls_pdf.swf",
    did you try this:
    var oTable = $('#percloc3').dataTable({ "sDom": 'T<"clear">lfrtip', "oTableTools": { "sSwfPath": "TableTools/media/swf/copy_cvs_xls_pdf.swf", } });
    2. Are You missing ?
This discussion has been closed.