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

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

124»

Replies

  • nate8684nate8684 Posts: 1Questions: 0Answers: 0
    My buttons still aren't working even after following all of the instructions here. Any ideas what could be causing this? I've seen a lot of post on flash security but nothing on how to fix that. Please help!
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Link to a test case please...! http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • waly0214waly0214 Posts: 2Questions: 0Answers: 0
    Allen,

    Great code. Just one question since I cannot seem to find it anywhere. When I go to export to pdf how do I force it to save as a .pdf? Thanks for your help on this issue.

    Thanks.

    Will
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    I do this to give a default name with the .pdf extension

    [code]
    "aButtons": [
    "copy",
    {
    "sExtends": "pdf",
    "sFileName": "ppg.pdf"
    },
    "print"
    ]
    [/code]

    Allan explains here http://datatables.net/forums/discussion/4088/saving-to-xls/p1 why you can't force the .pdf in Flash.

    Steph
  • waly0214waly0214 Posts: 2Questions: 0Answers: 0
    Thanks essexsteph

    Will
  • gpcode77gpcode77 Posts: 1Questions: 0Answers: 0
    PROBLEM SOLVED:

    first: add your http://localhost in the flash permission at:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

    second: use full path in your javascript
    example:

    "oTableTools": {
    "sSwfPath": "http://localhost/webfolder/copy_csv_xls_pdf.swf";
    }
  • janvanrijnjanvanrijn Posts: 2Questions: 0Answers: 0
    I'm also having problems with implementing table tools. I have a page with multiple tabs (Bootstrap), and in each tab, a DataTable (using TableTools) is shown. On the initial active tab, Tabletools functions are working fine. On all other tabs, tabletabs functions don't work.
    [code]


    // contents


    [/code]
    [code]


    // content


    [/code]
    In the uppertable, the table tools work, in the other one they don't. When I switch the active class, table tools works for the table at the bottom. When I put the active class at both tables, it works for both (but this messes up the display of the page) and when I totally remove the active class, it doesn't work anymore.

    Any ideas?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Very likely you need to use the http://datatables.net/extras/tabletools/api#fnResizeButtons API function when the tab is made visible, since it doesn't have height / width before that point.

    Allan
  • janvanrijnjanvanrijn Posts: 2Questions: 0Answers: 0
    Hi Allen,

    Thank you so much for the quick response! I'm now facing a different problem, maybe you have seen it before:

    I have installed the Bootstrap Integration Files, (css and JS) and all seems to work pretty fine. However, when I try to put some of the buttons in a collection, the fnClick action (and others) are not invoked anymore when clicked on the Button. The fnInit function is invoked upon creation.

    I looked over the internet to find similar problems, but couldn't find them. Also in the most basic configuration, this problem manifests itself. Whenever I remove the last part of the bootstrap integration js (starting with "if ( $.fn.DataTable.TableTools ) {" on line 115) the problem is solved, however the layout is also back to basic.

    [code]
    //Initialse DataTables, with no sorting on the 'details' column
    var oTableRuns = $('#datatable_main').dataTable( {
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "api_query/table_feed",
    "sServerMethod": "POST",
    "aoColumnDefs": [
    { "bSortable": false, "aTargets": [ 0 ] },
    { "bSearchable": false, "bVisible": false, "aTargets": [ 1, 2 ] },
    ],
    "sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
    "oTableTools": {
    "sSwfPath": "SWF/tableTools/copy_csv_xls_pdf.swf",
    "aButtons": [
    { // TODO: these buttons don't work anymore.
    "sExtends": "collection",
    "sButtonText": "Export ",
    "aButtons": ["copy","print","csv", "xls", "pdf"],
    },
    {
    "sExtends": "text",
    "sButtonText": "Toggle Results",
    "fnClick": function toggleResults(nButton,oConfig,oFlash) {
    oTableRunsShowAll = !oTableRunsShowAll;
    oTableRuns.fnDraw(true);
    },
    },
    ],
    },
    "aaSorting": [[5, 'desc']],
    "aLengthMenu": [[10, 50, 100, 250], [10, 50, 100, 250]],
    "iDisplayLength" : 50,
    "bAutoWidth": false,
    "bPaginate": true,
    });
    [/code]
  • anupalusoftanupalusoft Posts: 3Questions: 0Answers: 0
    Try to put the files on localhost or on your web server. you must have to check the path to swf file or manually set it.
    I was facing this issue on local computer. as i put it on localhost Woom!! all working fine.
  • fsunjivefsunjive Posts: 3Questions: 0Answers: 0
    Dear sir,
    I try to work with example that you have given in your download page, Still I couldn't work it on.
    Please tel me whats wrong with my code, No errors shown in my browser console, and only the print button is working fine.others are not working.

    TableTools example

    @import "../../media/css/demo_page.css";
    @import "../../media/css/demo_table.css";
    @import "media/css/TableTools.css";






    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "media/swf/copy_csv_xls_pdf.swf"
    }
    } );
    } );





    TableTools example


    This example I downloaded from your site, but still other buttons than print are not working
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Please link to a test page showing the error. See http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • fsunjivefsunjive Posts: 3Questions: 0Answers: 0
    hi allan,
    Thanks for your time,I was the flash security exception had running through all the time, Once I uploaded my code to the web-server all works fine and thank you very much.
  • anil777anil777 Posts: 1Questions: 0Answers: 0
    Hi allan,

    I am using data tables. In print,pdf I need to include my own logo. how is it make a possible way.

    Thanks in advance
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Use the sMessage option: http://datatables.net/extras/tabletools/button_options#sMessage . That will accept a plain HTML string, so you would just use a standard tag.

    Allan
This discussion has been closed.