TableTools CSV export only working in Chrome

TableTools CSV export only working in Chrome

pstoller78pstoller78 Posts: 4Questions: 0Answers: 0
edited June 2012 in TableTools
I am having problems with the CSV export feature. It seems to work fine in chrome, but only reloads the page in chrome.

Any advice would be welcomed.

Here is the code I am using.

[code] $(document).ready(function() {
getAssignments(thisUserAccount, currentUserType);
$('#centralDiv').html( "Quality Assgnments for the teams of "+FL+" for the month of "+thisMonth+" " );
$('#assignmentstable').dataTable( {
"bPaginate": false,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [
"csv",
"print"
]
},
"aaData": assignedtasks,
"aoColumns": [
{ "mDataProp": "Analyst", "sTitle": "Analyst", "sClass": "center" },
{ "mDataProp": "Supervisor", "sTitle": "Supervisor", "sClass": "center" },
{ "mDataProp": "Workgroup", "sTitle": "Workgroup", "sClass": "center" },
{ "mDataProp": "CompletedReviews", "sTitle": "Completed Reviews", "sClass": "center" },
{ "mDataProp": "ReviewsToBeCompleted", "sTitle": "Reviews To Be Completed", "sClass": "center" },
{ "mDataProp": "AverageForThePeriod", "sTitle": "Average for the Period", "sClass": "center" },
{ "mDataProp": "AssignmentSet", "sTitle": "Assigned Quizes", "sClass": "center" },
{ "mDataProp": "ScorecardLink", "sTitle": "ScorecardLink", "sClass": "center" }
]
} );
} ); [/code]

Replies

  • fearednerdfearednerd Posts: 44Questions: 0Answers: 0
    is the .swf file in the right location? If you moved it you need to set up the swf path with sSwfPath.
  • pstoller78pstoller78 Posts: 4Questions: 0Answers: 0
    I believe it's in the correct location. I am not getting any 404 errors and the feature works when in chrome. Every time I try to set the path explicitly the page will not render for me. I am using this feature inside of a MS Sharepoint page so I don't know if that makes any difference.
  • pstoller78pstoller78 Posts: 4Questions: 0Answers: 0
    Does anyone have some suggestion. I can provide more data if needed. Since the site is not available externally I can't provide direct access. But I can provide any other information if needed.

    I'm not sure why it would work in chrome but not IE or FF. I am also not sure why when I try to explicitly define the file path the page fails to load.
  • melphmelph Posts: 37Questions: 1Answers: 0
    Hi

    I have struggled with this all night - I have now revert to use table tools version 2.0 which can be downloaded from here: https://github.com/DataTables/TableTools/tags

    Make sure you change the "sSwfPath": to

    /media/swf/copy_cvs_xls_pdf.swf"

    The important bit here is that on this version, the middle part of the file was called cvs as opposed to later files showing csv!!!

    Dont know why it would work in IE and not firefox, but at least with version2, it works in both

    Hope this helps
  • melphmelph Posts: 37Questions: 1Answers: 0
    Forget that - just found that once you open up the exported files, they are empty! So, whilst it appears to work, it doesnt!
  • andreivassalievandreivassaliev Posts: 5Questions: 0Answers: 0
    edited June 2012
    Hello,

    I was using TableTools 2.0.3 and decided to update the plugin into 2.1.1.

    Now, CSV and Copy export work only on Chrome. It doesn't work on Firefox (12 & 13), nor on IE 8.
    All was fine with TableTools 2.0.3

    I use the plugin with Datatables 1.9.1 and JQuery 1.7.2
    I checked the sSwfPath, and it's ok.

    Here is the code i'm using:

    [code]
    $('#mytable').dataTable({
    "sDom": '<"dataTables_header"<"dataTables_topinfo"i><"dataTables_toppaginate"p>lfT>rt<"dataTables_footer"<"dataTables_bottompaginate"p><"dataTables_bottominfo"i>>',
    "bRetrieve": true,
    "oLanguage": {
    "sLengthMenu": "Show _MENU_ Results",
    "sInfo": "Showing _START_ to _END_ of _TOTAL_ results",
    "sInfoEmpty": "No Results",
    "sInfoFiltered": "(filtered from _MAX_ total results)",
    "oPaginate" :{"sNext" :"", "sPrevious" : ""}
    },
    "oTableTools": {
    "sSwfPath": "../web/applet/copy_csv_xls.swf",
    "sRowSelect": "none",
    "sSelectedClass": "DTTT_selected",
    "fnPreRowSelect": null,
    "fnRowSelected": null,
    "fnRowDeselected": null,
    "aButtons": [ "copy",
    {"sExtends": "csv","sFileName": "mydata.csv","bFooter": false},
    {"sExtends": "print","sInfo": "Print viewPlease use your browser's print function to "+"print this table. Press ESC (Escape) key to go back."}
    ]
    }
    });
    }
    [/code]
    Thanks a lot for your help, i go crazy .. :/
  • andreivassalievandreivassaliev Posts: 5Questions: 0Answers: 0
    It seems there's a problem with the element, created by ZeroClipboard, inside the element.
    When i modify the HTML code with Firebug and move the element outside of the one, all works fine again on Firefox.

    exemple:
    (original code, doesn't work):
    [code]

    CSV



    [/code]

    (modified code, works !!! ):
    [code]

    CSV



    [/code]
  • andreivassalievandreivassaliev Posts: 5Questions: 0Answers: 0
    Hi, I fixed the problem by using the ZeroClipboard.js file from TableTools 2.0.3 instead of the one from the tableTools 2.1.1 package.

    All is ok now on all browsers. Hope this will help:)
  • melphmelph Posts: 37Questions: 1Answers: 0
    Where did you download the 2.03 package from - I have come to DataTables just recently so don't have all the older versions - I would like to try your fix

    Mark
  • melphmelph Posts: 37Questions: 1Answers: 0
    Found it here

    https://github.com/DataTables/TableTools/blob/52d8188f89e84292da0f656e3928ccc6efcf235b/media/js/ZeroClipboard.js

    And replaced as per Andreivassaliev comments, and yes, it works fine in Firefox 13, IE9 and latest Chrome release - have not tested in Safari.

    Thanks for this
  • andreivassalievandreivassaliev Posts: 5Questions: 0Answers: 0
    Hi Melph,

    I had the 2.0.3 package saved on my own computer (it was my last recent version of TableTools). But, I don't know if there's an archive section on the website, sorry :s

    I may email the corresponding file to you if needed ;)
  • melphmelph Posts: 37Questions: 1Answers: 0
    Thanks - found it all ok
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    HI all,

    Unfortunately some of my changes in TableTools 2.1.0 caused compatibility issues with Firefox and IE - specifically, to try and make life easier, I had the Flash element inside the BUTTON tag - but Firefox and IE will not allow Flash to pick up the mouse down / up events (although they do oddly allow mouse in / out) - hence the trouble.

    The fix has been committed for this and I'll be packaging up the latest TableTools for release soon. Until then, you can get the latest version with the required fix from the downloads page or Github.

    Please accept my apologies for the inconvenience.

    Allan
  • andreivassalievandreivassaliev Posts: 5Questions: 0Answers: 0
    Hello Allan

    Thank you :)
    You don't have to apologize, you make a very good work and we'll never thank you enough for this ;)
  • melphmelph Posts: 37Questions: 1Answers: 0
    I agree, not your problem browsers suck! Next project Allan, design a browser and then get the entire web browsing community to use it! Sounds easy :-)
  • pstoller78pstoller78 Posts: 4Questions: 0Answers: 0
    Sorry for my late follow up to this. Thank you everyone for looking at this. I look forward to applying the update.
This discussion has been closed.