Problem in export buttons

Problem in export buttons

viharshahviharshah Posts: 2Questions: 1Answers: 0

Hi all,
I am using https://datatables.net/extensions/buttons/examples/initialisation/export.html for my reports

I have put below code on document ready

$(document).ready(function() {
BindInvoiceReport();
$('#example').DataTable({
dom: 'Bfrtip',
buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
});
});

function BindInvoiceReport() {
$.ajax({
type: "POST",
url: "/admin/invoice-report.aspx/GetInvoiceReport",
data: '{"FromDate": "' + $('#txtFromDate').val() + '","ToDate": "' + $('#txtToDate').val() + '"}',
contentType: "application/json; charset=utf-8", dataType: "json",
success: function(datas) {
var dt = $.parseJSON(datas.d);
if (dt.totalRecords > 0) {
$('#tblOrders').html('');
$('#tblOrders').html(dt.result);
$('#tblPagingF').html(dt.paging);
}
else {
$('#tblOrders').html('');
}
window.setTimeout(function() { CloseHlsPopup(); }, 200);
}
});
}
In BindInvoiceReport i am binding data to table which is below

Invoice Id # Customer Cashier Order Date Invoice Type Options Details Sub Total Total ($)

But buttons are not working i cannot use any of functionality. If i am putting static data then it is working fine.

Please help me guys

Answers

  • viharshahviharshah Posts: 2Questions: 1Answers: 0

    I have put html code but in convert when i ask question.
    tblOrders is id of tbody and example is id of table

  • allanallan Posts: 61,878Questions: 1Answers: 10,138 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.