Export in excel format

Export in excel format

thewebsurferthewebsurfer Posts: 2Questions: 0Answers: 0
edited July 2012 in General
hi admins, congrats for this very helpful script :)
i'm wondering if is possible export the table in xls format, it would be very convenient to me

ps: i tried to translate in italian (with the plugin), but i can't..

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    http://datatables.net/extras/tabletools/ :-)

    Note that it is actually exporting in CSV UTF-16LE format, but Excel reads it no problem at all. If you need proper Excel file support, then you'll need to create a script on the server which would export the data in the required format, or modify TableTools to do it.

    Allan
  • thewebsurferthewebsurfer Posts: 2Questions: 0Answers: 0
    edited July 2012
    ok, there's something i do wrong

    i simply paste the plugin code, heres my table initialization
    [code]$(document).ready(function() {
    $('#datashow').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/swf/copy_csv_xls_pdf.swf"
    },
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "datatables/server_side/scripts/server_processing.php"

    } );
    } );[/code]

    why this dont work?

    ps: can i select just a few row of the table to export?
  • jleejlee Posts: 2Questions: 0Answers: 0
    allan, even in your example, it is trying to save the file using the extension .csv. I realize it is as simple as changing that to xls, but is there a way to do this automatically?
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Yes - http://datatables.net/extras/tabletools/button_options#sFileName
  • jleejlee Posts: 2Questions: 0Answers: 0
    thanks for the quick response. that was exactly what i needed.
This discussion has been closed.