Colvis + Tabletools export problems

Colvis + Tabletools export problems

wazzawazza Posts: 10Questions: 0Answers: 0
edited August 2011 in General
Hi everyone, I've encountered such kind of a problem: when I try to export a table with not all the columns enabled, there appear some interesting effects:
-when exporting to clipboard or xls\csv, the data is generated almost fine, however all of the columns are enabled in the generated files
-when exporting to pdf, everything goes wrong:
http://imageshack.us/photo/my-images/695/troubleb.jpg/
as you can see, all the columns turn enabled and are placed somewhere on the pdf, above random columns. There are other faces of this bug, especially spectacular it becomes when last rows are disabled - these rows are formed into a 1-3 symbol line on the right border, that stretches after each page with table data...
When all the columns are enabled, this problem disappears

Looking forward to any possible solutions :) if such functionality, as exporting incomplete table is not possible, is there a chance to at least automatically export the whole table with all the rows enabled, similar to what is done in csv\txt export functions?

P.S., I'm using the latest versions, according to mDataProp fix, discussed here:
http://www.datatables.net/forums/discussion/comment/23499#Comment_23499

Replies

  • wazzawazza Posts: 10Questions: 0Answers: 0
    Here is the .zip file with this example, so the bug is easily reproduced.

    http://depositfiles.com/files/usvw0cpln

    P.S. with no mDataProp fix, just the current nightly versions. tried the same thing with the stable version, but everything stays the same.
  • MichaelBruhnMichaelBruhn Posts: 5Questions: 0Answers: 0
    edited January 2012
    Was this problem ever solved ??????.
    I am also using Tabletools and Colvis, and when excluding columns via ColVis , it's ok in Print and PDF(almost , it doesn't look good) , but shows only the columns I wanted via ColVis.
    But excel, copy and csv shows all columns , also those I excluded via ColVis ???????

    My jquery code :

    var jqLengthMenu = "";
    var jqZeroRecords = "";
    var jqInfo = "";
    var jqInfoEmpty = "";
    var jqInfoFiltered = "";
    var jqShowHideCols = "";
    var jqSearchButtonText = "";

    $(document).ready(function() {
    $('#searchResultsjq').dataTable( {
    "bJQueryUI": false,
    "sPaginationType": "full_numbers",
    "oLanguage": {
    "sLengthMenu": jqLengthMenu,
    "sZeroRecords": jqZeroRecords,
    "sInfo": jqInfo,
    "sInfoEmpty": jqInfoEmpty,
    "sInfoFiltered": jqInfoFiltered,
    "buttonText" : jqShowHideCols,
    "sSearch": jqSearchButtonText
    },
    "sDom": 'CT<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/MyPSAM/DataTables-1.8.1/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf"
    },
    "oColVis": {
    "activate": "mouseover",
    "sAlign": "right",
    "buttonText": jqShowHideCols,
    "bRestore": true
    }


    } );
    } );
  • allanallan Posts: 62,338Questions: 1Answers: 10,228 Site admin
    The mColumns option can be used to define what columns to export: http://datatables.net/extras/tabletools/button_options#mColumns

    Allan
  • altsysetaltsyset Posts: 10Questions: 0Answers: 0
    Thnx allan that helped alot
  • systematicalsystematical Posts: 23Questions: 0Answers: 0
    edited January 2013
    Thanks this was super helpful. The following configuration worked great for me:

    [code]
    "oTableTools": {
    "sSwfPath": "/lib/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
    "aButtons": [
    "copy",
    "print",
    "xls",
    {
    "sExtends": 'pdf',
    "mColumns":[1,2,3,4]
    }
    ]
    },
    [/code]

    Columns 0,5, and 6 are excluded from the PDF export
This discussion has been closed.