diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index 96a3f30b..35d114a7 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -232,14 +232,22 @@ $(document).ready(function() { extend: 'csv', text: 'CSV', title: 'Policy-Tranction-BDS-List', - customizeData: function (data) { - for (var i = 0; i < data.body.length; i++) { - for (var j = 0; j < data.body[i].length; j++) { - // force text format by prefixing a tab - data.body[i][j] = '\t' + data.body[i][j]; + exportOptions: { + columns: ':visible', // or specify exact columns [0,1,2,...] + format: { + body: function (data, row, column, node) { + // Force K and L columns to string + if (column === 10 || column === 11) { + // Option 1: prepend single quote + return '\u200C' + data; + + // Option 2: use Excel formula trick + // return '="' + data + '"'; + } + return data; } } - } + }, }, { extend: 'excel',