How to hide a Column when Exporting DataTable into PDF file

How to hide a Column when Exporting DataTable into PDF file

MichaelLandMichaelLand Posts: 26Questions: 0Answers: 0
edited October 2012 in General
Hello All,

I have tried to hide a Column from my Table when Exporting it into PDF file.

Code that below hides the column when pressing PDF Export-button but File Save as Dialog is not open...

How to get that Save as Dialog to work?

Thanks,

Mike

"fnClick": function (nButton, oConfig, oFlash) {
datatable.fnSetColumnVis(7, false);
$('div.dataTables_scrollHead').show();
$(window).keyup(function () {
oTable.fnSetColumnVis(7, true);
});
}

Replies

  • MichaelLandMichaelLand Posts: 26Questions: 0Answers: 0
    Found solution myself, just putting those columns that you need

    "mColumns": [0, 1, 2, 3, 4, 6]
  • MichaelLandMichaelLand Posts: 26Questions: 0Answers: 0
    Arrrgg, I have multipe tables containing different count of columns so [0, 1, 2, 3, 4, 5, 6] doesn't work in case where a row have less or more columns than seven. And I would like hide the last column from PDF.

    I tried code like this but didn't work. Can anyone please help, thanks

    "mColumns": function () {
    datatable.fnSetColumnVis(datatable.oSettings.aoColumns.length - 1, false);

    }
  • MichaelLandMichaelLand Posts: 26Questions: 0Answers: 0
    Can't anyone give a hint how to implement it?
This discussion has been closed.