Colvis + Tabletools export problems
Colvis + Tabletools export problems
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
-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
This discussion has been closed.
Replies
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.
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
}
} );
} );
Allan
[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