export in datatable export every format

export in datatable export every format

PrashantBhattPrashantBhatt Posts: 4Questions: 2Answers: 0

~~{extends file="./main.tpl"}
{block name="head"}
<link rel="stylesheet" href="css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.5.2/css/buttons.dataTables.min.css">

{/block}
{block name=body}

All Party Ledger

  1. Home
  2. All Entry
  3. All Entry List
  4. All Party Ledger
Select Party {html_options values=$typearray.party_type_id output=$typearray.party_type_nm selected=$party_type_id}
{section name="sec" loop=$categoryArray} {/section} Total Amount {$finalAmt}
Date Party Name Total Kg Kg Total Amount
{$categoryArray[sec].all_date} {$categoryArray[sec].partyName} {$categoryArray[sec].totalkg} {$categoryArray[sec].kg} {$categoryArray[sec].totalAmt}
Date Party Name Total Kg Kg Total Amount

{/block}
{block name="scriptjs"}

function getparty() { var dataString = "party_type_id=" +$(".party_type_id").val(); $.ajax({ type: "GET", url: "city.php", data: dataString, success:function(data) { $("#partyComboSpan").html(data); } }); } $(function () { $('#example1').DataTable({ 'paging' : true, 'lengthChange': true, 'searching' : true, 'ordering' : true, 'info' : true, 'autoWidth' : true, dom: 'Bfrtip', buttons: [ { extend: 'print', footer: 'true' }, { extend: 'excel', footer: 'true' }, { extend: 'csv', footer: 'true' }, { extend: 'pdf', footer: 'true' } ], "footerCallback": function ( row, data, start, end, display ) { var api = this.api(), data; // Remove the formatting to get integer data for summation var intVal = function ( i ) { return typeof i === 'string' ? i.replace(/[\$,]/g, '')*1 : typeof i === 'number' ? i : 0; }; // Total over all pages /* totalkg = api .column( 2 ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); kg = api .column( 3 ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); totalamount = api .column( 4 ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 );*/ // Update footer $( api.column( 1 ).footer() ).html('Total'); $( api.column( 2 ).footer() ).html(totalkg); $( api.column( 3 ).footer() ).html(kg); $( api.column( 4 ).footer() ).html(totalamount); } }) })

{/block}
~~

This discussion has been closed.