Table tools v2 copy/xls/csv/pdf dont work - Page 2

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

24

Replies

  • dvnandoverdvnandover Posts: 42Questions: 0Answers: 0
    I downloaded the TableTools version 2.0 and the problem gone away and everything worked.
    You can download version 2.0 here:
    https://github.com/DataTables/TableTools/tags
  • mokumaxmokumax Posts: 7Questions: 0Answers: 0
    This is the same for us. Print works but nothing else. The thing that is strange is that the Print button is the only one that when you hover over it it actually changes to the colored PNG. The others don't show the hovered image.

    Any other thoughts?

    Thanks,
    Craig
  • christianhanveychristianhanvey Posts: 2Questions: 0Answers: 0
    I also had the issue of buttons appearing but doing nothing when clicked, and although I'm not sure of the exact reason why it happened, it discovered it was related to hiding the element that contained the table (using display:none).

    I got around the issue by removing the display:none property on the rule, and setting z-index:-1 instead, to hide the element behind others on the page, and then altering this to a higher value (eg z-index:30) when required before making the table container visible.

    Suddenly the buttons are working as expected!
    Hopefully this helps someone else diagnose their issue.
  • christianhanveychristianhanvey Posts: 2Questions: 0Answers: 0
    I found something relating to this in the docs (imagine that), where a function exists which you can trigger a redraw of the flash buttons, as they can't be drawn properly if the element is initially hidden.
    More about it here under fnResizeRequired:
    http://datatables.net/extras/tabletools/api
  • bloodersblooders Posts: 10Questions: 0Answers: 0
    edited January 2012
    I too had major problems getting this to work. All of them my own fault.

    1) I hadn't set the path for the swf correctly and sure enough I had 404s showing in firebug (Net).

    2) If your table is hidden in any way use fnResizeButtons as described below. I not only had tabs but also hidden divs:

    http://datatables.net/extras/tabletools/api#fnResizeButtons

    Similar here:

    http://datatables.net/release-datatables/examples/api/tabs_and_scrolling.html

    3) Thanks Luke for suggesting this one, I don't know how much more time I'd have spent looking for it otherwise ...

    I had managed to corrupt the delivery of the swf file. The 404s ceased but my problems still persisted.

    I'd inadvertently used the same character stream type (server side) that I use for delivering text file resources!

    This corrupted the file but it was not apparent from any of the client side flash debugging / logging
    utilities. All I got was something like 'Movie not loaded' when I right clicked the flash buttons!

    Note, when serving the swf, also make sure you set the content type correctly, i.e.

    application/x-shockwave-flash

    If you think you've fixed all other issues, and suspect the serving of the file may be corrupting it,
    consider locating the (original) file locally on the test client machine. You will have to change the
    swf path and flash security settings (see Allan's comment, on this thread, October 2011).

    I hope this helps.
  • bloodersblooders Posts: 10Questions: 0Answers: 0
    And there's more ...

    When we deployed to our test environment we found the file corruption returned. This time, however, the problem was caused by our maven build.

    The symptoms:
    1) The same inactive flash buttons as described above.
    2) The swf file was being served as a file of about 1.8k when it should have been 2.1k.

    The fix:
    Check out the warning at the bottom of the following page:
    http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
  • MeghanaMeghana Posts: 3Questions: 0Answers: 0
    edited January 2012
    I have an issue using table tools plugin in my portal application.

    The only button that works is the print. When I right click on the CSV/Excel button is shows two options
    1) Movie not loaded
    2) About Adobe Flash 11.1.102.55

    I have the swf file in the right location and is reachable. I do not see any 404 errors in firebug.

    I set sSwfPath:"copy_cvs_xls_pdf.swf" and the TableTools.min.js and swf files are in the same folder.


    How do I resolve this issue.
  • jyothijyothi Posts: 1Questions: 0Answers: 0
    Hi Allan,

    Firstly I would like to thank for such a great tool.

    I am facing some problem using Table tools. Actually i am implementing to export data through CSV and pdf formate. Its works absoultly fine with local host. whereas once we deployed to development instanst, the flash buttons are not showing as a clickable aswell nothing happening when we click on csv or pdf also we dont find any errors. I am using version:"1.0.4-TableTools2".

    It would be really great & helpfull if you provide a solution...

    thanks,
    jo
  • jraa22jraa22 Posts: 2Questions: 0Answers: 0
    Hi Allan,

    I'm having problems with csv and pdf. Look, everything works fine if I run the swf_path.html in the default route. But it doesnt works if I move that file to the root (obviously I updated routes too.).

    Flash is running but when the pop up window is open to save the file (pdf, csv or excel) it loses the document type. In other script, it opens the pop up windows to save the file but my browser close it or gets freeze

    I need some help. Thanks
    Sorry for my english I'm still studying :)
  • scubajoescubajoe Posts: 1Questions: 0Answers: 0
    Hi All, Great script

    Is there a smaller version of jquery.dataTables.js ?

    i use it only to export a table to pdf and 364kb is to big for what i use it for

    cheers!

    Sam
  • giabmfgiabmf Posts: 1Questions: 0Answers: 0
    edited April 2012
    So I've been trying to get this thing working all day and I'm still at square one. I've tried everyone's suggestions, I've even installed three other browsers to see if that is an issue. What's even more surprising is the buttons appear and function fine on my coworkers box and we're using the same code base so what could the issue be? After inspecting the html the classid is loading correctly but the buttons just won't work. After looking at the response codes in fiddler, the path to the swf is getting loaded correctly. I'm using the most recent version of TableTools and the DataTable. Can someone please help?

    Here is my code:

    $(document).ready(function () {

    var dt = $('#LogTable').dataTable({
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/Scripts/media/swf/copy_csv_xls_pdf.swf"
    },
    "bPaginate": false,
    "bInfo": false,
    "bProcessing": true,
    "bScrollInfinite": true,
    "bScrollCollapse": true,
    "sAjaxSource": "Log/Details",
    "fnServerData": function (url, data, callback) {
    $.ajax({
    "url": url,
    "data": data,
    "success": callback,
    "contentType": "application/x-www-form-urlencoded; charset=utf-8",
    "dataType": "json",
    "type": "POST",
    "cache": false,
    "error": function () {
    alert("DataTables warning: JSON data from server failed to load or be parsed. " +
    "This is most likely to be caused by a JSON formatting error.");
    }
    });
    },
    "bServerSide": true,
    "sScrollY": "600px",
    "bDeferRender": true,
    "aoColumns":
    [
    { "aTargets": [0], "bSearchable": true, "bSortable": true },
    { "aTargets": [1], "bSearchable": true, "bSortable": true },
    { "aTargets": [2], "bSearchable": true, "bSortable": true },
    { "aTargets": [3], "bSearchable": true, "bSortable": true }
    ],
    "sZeroRecords": "Loading data from server...",
    "fnInitComplete": function (oSettings) {
    oSettings.oLanguage.sZeroRecords = "No matching records were found.";
    }

    });

    $("#accordion").accordion({
    collapsible: true
    });

    });
  • kaspaaskaspaas Posts: 2Questions: 0Answers: 0
    I also have same problem: I can see all the buttons but only print works. The reference to the swf file are correct are there are no 404 errors and no js errors in the dev tools in Chrome. I've checked the example on the site http://datatables.net/release-datatables/extras/TableTools/pdf_message.html and that works fine in Chrome. It also works fine in IE(9) and Firefox. Any suggestions would be great
  • nawienawie Posts: 1Questions: 0Answers: 0
    i alse have the same problem too,and got stuck on it..
    after i saw the directory of swf file and amazed that there are two swf version,
    one from previous version of datatables named "copy_cvs_xls_pdf.swf" and one from new datatables "copy_csv_xls_pdf.swf".

    renamed my swf source to newer and now it works well
  • kishorekishore Posts: 1Questions: 0Answers: 0
    Hi Allan,

    I am also a fan of yours and Datatable/Tabletools etc.
    I am able to do export excel/PDF/copy however,
    I need the headers in bold,is it possible and can we format the cell to give some size?

    Regards,
    Kishore
  • AndyDAndyD Posts: 1Questions: 0Answers: 0
    I was having similar issues with the buttons not working until I realised that the filename I was looking for was not correct, I was including (copy_cvs_xls_pdf) in my path (as are many of the examples posted above) when in fact the correct filename in my folder was (copy_csv_xls_pdf) - CVS/CSV being the point of difference.

    Hope it helps.
  • IvanwIvanw Posts: 7Questions: 0Answers: 0
    I've also had the same problem with getting the csv and pdf buttons to work when declaring them as part of a "collection". When I declare them as standalone buttons as below everything works as it should. Strange.

    "aButtons": [
    "print",
    {
    "sExtends": "pdf",
    "sButtonText": "Print PDF",
    "mColumns": "visible"
    },
    {
    "sExtends": "xls",
    "sButtonText": "Export to Spreadsheet",
    "mColumns": "all"
    }
    ]
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    I'm afraid that this is a bug in TableTools 2.0.3 :-(. It will work fine in 2.0.2, but I introduced a change which unfortunately broke that in 2.0.3 - I will be looking at correcting that and issue a new release soon.

    Allan
  • mwirthmwirth Posts: 1Questions: 0Answers: 0
    Thanks @AndyD!

    I was facing the same issues with non-working buttons. This originated also from the "typo" in the filename within the swf folder "copy_cvs_xls_pdf" and the filename that is given in the example page for TableTools "media/swf/copy_csv_xls_pdf.swf".

    Tiny difference, hard to catch. :)

    I also use this occasion to say a big "Thank you, Allan" for sharing this project!
  • jkarnofskyjkarnofsky Posts: 1Questions: 0Answers: 0
    Hey Allen - Thanks! I seem to have gotten the right combination in the meantime...

    Datatables: 1.9.1
    Reverted to TableTools: 2.0.2
    Referencing: copy_cvs_xls_pdf.swf (not copy_csv_xls_pdf.swf)

    Using The following JS (Forgive me, I've forgotten who posted this originally, I found it through these forums)


    [code]
    $("#report-tabs").tabs( {
    "show": function(event, ui) {
    var jqTable = $('table.display', ui.panel);
    if ( jqTable.length > 0 ) {
    var oTableTools = TableTools.fnGetInstance( jqTable[0] );
    if ( oTableTools != null && oTableTools.fnResizeRequired() )
    {
    /* A resize of TableTools' buttons and DataTables' columns is only required on the
    * first visible draw of the table
    */
    jqTable.dataTable().fnAdjustColumnSizing();
    oTableTools.fnResizeButtons();
    }
    }
    }
    });
    [/code]
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    Hi Allan,

    I have Datatables v1.9.1 and TableTools2.1.1. I dont see any buttons but i get this message :
    Warning:TableTools2 requires Datatables1.9.0 or newer
    and then i get the table wihtout any of those buttons

    Pls help
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    I've just used the same Initialisation code and then replaced the .JS path with my local absolute path, Earlier i used the Datatables 1.8 for rest of the featues( displaying row details etc.) , i wanted to check the export option, so i 've downloaded the Tabletools2.1.1 , LAter i've downloaded Datatables1.9.1 and then replaced the ablsolute paths for .JS and .CSS and it still gives me the same message?
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    @Sid18 - please link to a test case showing the problem.

    Allan
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    I didnt get what is needed, but all i did was i just took the code for the below link:
    http://datatables.net/extras/tabletools/
    and then, just changed the corresponding path to the absolute path of my local machine.

    The message i got was the one i pasted above. It was a pop-box and after clicking ok, i just got the empty table displayed with the message as "Loading data from server" only the table top line and thebottom line were displayed.

    I hope i am clear this time.
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    Pls ignore the "Loading data from Server" part, i just realised it was a statement as a part of the code.
    But i still donot see any of the buttons displayed, though i get the warning and then only the table is displayed - I still donot see any of the buttons nor the links for exporting prupose.

    Kindly look and respond.

    TIA
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    Sorry for my number of Posts, but i've checked the same in Chrome too and got the same output. Couldnt see the Buttons displayed. And i get the warning message too. My IE version is IE7.

    I would like to explore on the Exporting options, Would be great if you can assist/guide me with the above inputs and suggest any other ways/ideas that i can implement to make this work.

    Thanks
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Perfectly clear - it is not working. But in order to understand why it is not working, I will need a link to the page with the problem. As you can see from my examples pages TableTools does work, so there is something in your server environment which is making it not work I suspect. To understand what that is, I would need to see it.

    Allan
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    can i paste the code here? or is there a way i can attach my file?
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    edited June 2012
    Try http://live.datatables.net or JSFiddle, but it really would be best if you could just give me a link to your test page showing the problem.

    Allan
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    Here is the code attached:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">



    DataTables - TableTools







    div.dataTables_wrapper { font-size: 13px; }
    table.display thead th, table.display td { font-size: 13px; }








    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "C:/Documents and Settings/nbkagsd/My Documents/MAS/POC/POC/TableTools-2.1.1/TableTools-2.1.1/media/swf/copy_csv_xls_pdf.swf"
    }
    } );
    } );






    Example




    Rendering engine
    Browser
    Platform(s)
    Engine version
    CSS grade




    Trident
    Internet
    Explorer 4.0
    Win 95+
    4
    X


    Trident
    Internet
    Explorer 5.0
    Win 95+
    5
    C


    Trident
    Internet
    Explorer 5.5
    Win 95+
    5.5
    A


    Trident
    Internet
    Explorer 6
    Win 98+
    6
    A


    Trident
    Internet Explorer 7
    Win XP SP2+
    7
    A


    Trident
    AOL browser (AOL desktop)
    Win XP
    6
    A


    Gecko
    Firefox 1.0
    Win 98+ / OSX.2+
    1.7
    A
  • Sid18Sid18 Posts: 14Questions: 0Answers: 0
    As you can see with my code, if you try to view this in the Browser, there is a warning first displayed and then the table rows are displayed - but with no Buttons!

    Your help is appreciated!
This discussion has been closed.