+ Remove white space when export to excel
This commit is contained in:
parent
31ac8e45d5
commit
890ff5c0e5
|
|
@ -200,6 +200,19 @@
|
||||||
'pageLength',
|
'pageLength',
|
||||||
{
|
{
|
||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
|
customizeData: function (data) {
|
||||||
|
for (var i = 0; i < data.body.length; i++) {
|
||||||
|
for (var j = 0; j < data.body[i].length; j++) {
|
||||||
|
// data.body[i][j] = '\u200C' + data.body[i][j];
|
||||||
|
if ([1, 2].includes(j)) {
|
||||||
|
// Get the value and strip the non numeric characters
|
||||||
|
// var value = $(this).text();
|
||||||
|
value = data.body[i][j].replace(',', ".")
|
||||||
|
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
customize: function (xlsx) {
|
customize: function (xlsx) {
|
||||||
var sheet = xlsx.xl.worksheets['sheet1.xml'],
|
var sheet = xlsx.xl.worksheets['sheet1.xml'],
|
||||||
sum = 0;
|
sum = 0;
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title"><?php echo $this->lang->line('recharge_historic'); ?></h3>
|
<h3 class="box-title"><?php echo $this->lang->line('refund_history'); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body" style="overflow-x:auto;">
|
<div class="box-body" style="overflow-x:auto;">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
||||||
|
|
@ -276,14 +276,29 @@ use Brick\Money\Money;
|
||||||
title: 'Histrotique des transactions',
|
title: 'Histrotique des transactions',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
|
},
|
||||||
|
customizeData: function (data) {
|
||||||
|
for (var i = 0; i < data.body.length; i++) {
|
||||||
|
for (var j = 0; j < data.body[i].length; j++) {
|
||||||
|
// data.body[i][j] = '\u200C' + data.body[i][j];
|
||||||
|
if ([3, 4, 7, 8, 9, 10, 11, 12, 13].includes(j)) {
|
||||||
|
// Get the value and strip the non numeric characters
|
||||||
|
// var value = $(this).text();
|
||||||
|
value = data.body[i][j].replace(',', ".")
|
||||||
|
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trim: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
extend: 'csvHtml5',
|
extend: 'csvHtml5',
|
||||||
title: 'Histrotique des transactions',
|
title: 'Histrotique des transactions',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
}
|
},
|
||||||
|
trim: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
extend: 'pdfHtml5',
|
extend: 'pdfHtml5',
|
||||||
|
|
@ -292,7 +307,8 @@ use Brick\Money\Money;
|
||||||
title: 'Histrotique des transactions',
|
title: 'Histrotique des transactions',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
||||||
}
|
},
|
||||||
|
trim: false
|
||||||
},
|
},
|
||||||
// 'colvis'
|
// 'colvis'
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue