I have an <ASP:GridView> with few columns with boolean values returned from SQL Server. I am using datatables plugin looks good but when I export the data to Excel, all are exporting to Excel except the bool values that show empty.
Here is my simple jQuery:
$(document).ready(function () {
$('#<%=GridView1.ClientID%>').DataTable({
dom: 'Bfrtip',
buttons: [
'excel'
]
});
});
I have tried as stated in the link https://m.datatables.net/forums/discussion/45691/excelhtml5-how-to-export-checkbox-data but in vain.
Tried code 1
columnDefs: [
{
"render": function (data, type, row) {
var i = $(data).prop("checked")===true?"Yes":"No";
return i;
},
"targets": [1,2,13,16,17,19]
}
]
It displays "NO" even bool col value is true.
Tried code 2
buttons: [
{
extend: 'excel',
exportOptions: { orthogonal: 'export' }
}
]
Tried code 3
buttons: [
{
extend: 'excelHtml5',
exportOptions: { orthogonal: 'export' }
}
]
Any help, thanks in advance.
$(data).prop("checked")trueorfalse. Please read my question carefully cuz I am only asking about$(data).prop("checked")false? I do not have access todataand you did not post it so I cannot tell.