Export checkbox checked state to excel
Export checkbox checked state to excel
rkbabu
Posts: 1Questions: 0Answers: 0
We need to export the checkbox checked state(True/False) to excel.
Currently it exports empty string.
This is the code currently we using
*Dynamically change lang according to localization*/
var langFile = "../Scripts/jquery.dataTables.en-US.txt";
if (locale === "zh-cn") {
langFile = "../Scripts/jquery.dataTables.zh-CN.txt";
}
var fileName = ($('#ctl00_hdnXlsFileName').val() || "xlsfileName");
var oTable = $('.gvDataTable').dataTable({
"oLanguage": {"sUrl": langFile},
"sScrollX": "99%",
"bDestroy": true, //To retrieve the datatables object for this table, pass no arguments or see the docs for bRetrive and bDestory
"bStateSave": true, //http://datatables.net/forums/discussion/573/how-to-stay-on-current-page-after-re-draw/p1
"fnDrawCallback": function (oSettings) {
/* Need to redo the counters if filtered or sorted */
if (oSettings.bSorted || oSettings.bFiltered) {
for (var i = 0, iLen = oSettings.aiDisplay.length; i < iLen; i++) {
$('td:eq(0)', oSettings.aoData[oSettings.aiDisplay[i]].nTr).html(i + 1);
}
}
$('.cbShowOrHideGvCols').appendTo('div.DTTT_container'); /*Put checkboxlist for show/hide columns after excel export*/
},
/*"sDom": 'r<"H"lf><"datatable-scroll"t><"F"ip>',*/
"sDom": '<"H"lTfr><"datatable-scroll"t><"F"ip>',
"oTableTools": {
"sSwfPath": "../Scripts/media/swf/copy_csv_xls_pdf.swf",
/*"sSwfPath": "http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",*/
"aButtons": [{ /*http://datatables.net/extras/tabletools/button_options*/
"sExtends": "xls",
"sFileName": fileName,
"sButtonText": "",
"sTitle": fileName.replace("xls","")
}
]
}
});
Currently it exports empty string.
This is the code currently we using
*Dynamically change lang according to localization*/
var langFile = "../Scripts/jquery.dataTables.en-US.txt";
if (locale === "zh-cn") {
langFile = "../Scripts/jquery.dataTables.zh-CN.txt";
}
var fileName = ($('#ctl00_hdnXlsFileName').val() || "xlsfileName");
var oTable = $('.gvDataTable').dataTable({
"oLanguage": {"sUrl": langFile},
"sScrollX": "99%",
"bDestroy": true, //To retrieve the datatables object for this table, pass no arguments or see the docs for bRetrive and bDestory
"bStateSave": true, //http://datatables.net/forums/discussion/573/how-to-stay-on-current-page-after-re-draw/p1
"fnDrawCallback": function (oSettings) {
/* Need to redo the counters if filtered or sorted */
if (oSettings.bSorted || oSettings.bFiltered) {
for (var i = 0, iLen = oSettings.aiDisplay.length; i < iLen; i++) {
$('td:eq(0)', oSettings.aoData[oSettings.aiDisplay[i]].nTr).html(i + 1);
}
}
$('.cbShowOrHideGvCols').appendTo('div.DTTT_container'); /*Put checkboxlist for show/hide columns after excel export*/
},
/*"sDom": 'r<"H"lf><"datatable-scroll"t><"F"ip>',*/
"sDom": '<"H"lTfr><"datatable-scroll"t><"F"ip>',
"oTableTools": {
"sSwfPath": "../Scripts/media/swf/copy_csv_xls_pdf.swf",
/*"sSwfPath": "http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",*/
"aButtons": [{ /*http://datatables.net/extras/tabletools/button_options*/
"sExtends": "xls",
"sFileName": fileName,
"sButtonText": "",
"sTitle": fileName.replace("xls","")
}
]
}
});
This discussion has been closed.