I believe I am missing something, probably the mapping of data is all out of wack. However the pdf export works fine but when I do "copy,csv ,export to excell" the data shows the number of rows but the data is not there but the header seems to come out fine.
jQuery.fn.DataTable.Api.register('buttons.exportData()', function (options) {
if (this.context.length) {
var jsonResult = $.ajax({
type: "POST",
//datatype: "html5",
url: "/Home/GetData/?CheckDate=' + $("#EventDates option:selected").val(),
success: function (result) {
},
async: false
});
var a = jsonResult.responseJSON;
return { body: jsonResult.responseJSON, header: $("#tblPayroll thead tr th").map(function () { return this.innerHTML; }).get() };
}
});