fix some revisi
This commit is contained in:
@@ -149,7 +149,21 @@
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Export Excel',
|
||||
buttons: ['excel', 'csv', 'pdf', 'print', 'colvis'],
|
||||
customize: function (xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
// Add additional information to the Excel sheet
|
||||
var additionalInfo = `
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
`;
|
||||
var rows = additionalInfo.split('\n').map(function (text) {
|
||||
return `<row><c t="inlineStr"><is><t>${text.trim()}</t></is></c></row>`;
|
||||
}).join('');
|
||||
|
||||
// Inject the additional information at the top of the sheet
|
||||
var data = $(sheet).find('sheetData').prepend(rows);
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
@@ -157,11 +171,10 @@
|
||||
customize: function (csv) {
|
||||
// Add header information to the CSV
|
||||
var additionalInfo = `
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
|
||||
`;
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
`;
|
||||
return additionalInfo + csv;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user