FIX_BDS_EXCEL_EXPORT_ISSE

This commit is contained in:
VENKATESHWARAN 2025-09-06 12:03:00 +05:30
parent 4b3793a645
commit cca7ad1df9
2 changed files with 34 additions and 19 deletions

View File

@ -1538,10 +1538,24 @@ class EmployeeController extends AdminController
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf'; $filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
if($mode == 1){ // if($mode == 1){
$dompdf->stream($filename, ['Attachment' => false]); // Inline view // $dompdf->stream($filename, ['Attachment' => false]); // Inline view
}else{ // }else{
$dompdf->stream($filename, ['Attachment' => true]); // Force download // $dompdf->stream($filename, ['Attachment' => true]); // Force download
// }
if ($mode == 1) {
// Inline view
return $this->response
->setHeader('Content-Type', 'application/pdf')
->setHeader('Content-Disposition', 'inline; filename="' . $filename . '"')
->setBody($dompdf->output());
} else {
// Force download
return $this->response
->setHeader('Content-Type', 'application/pdf')
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"')
->setBody($dompdf->output());
} }
$this->myLogger->logme('error', 'generateIDCardForEmployee function completed successfully.'); $this->myLogger->logme('error', 'generateIDCardForEmployee function completed successfully.');

View File

@ -190,6 +190,9 @@ $(document).ready(function() {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0; var total = 0;
// 🔹 Force column K (11) and L (12) as string
$('row c[r^="K"], row c[r^="L"]', sheet).attr('t', 'inlineStr');
// Find cells in column AB (28th column in Excel) // Find cells in column AB (28th column in Excel)
$('row c[r^="AB"]', sheet).each(function() { $('row c[r^="AB"]', sheet).each(function() {
var value = parseFloat($('v', this).text()); // Get the value inside the cell var value = parseFloat($('v', this).text()); // Get the value inside the cell
@ -210,21 +213,19 @@ $(document).ready(function() {
$(sheet).find('sheetData').append(totalRow); $(sheet).find('sheetData').append(totalRow);
}, },
exportOptions: { exportOptions: {
orthogonal: 'sort' orthogonal: 'sort'
}, },
customizeData: function (data) { customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) { for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) { for (var j = 0; j < data.body[i].length; j++) {
// Check if the column is the 9th index (10th column) and 10th index (11th column) // Check if the column is the 9th index (10th column) and 10th index (11th column)
if (j === 9 || j === 10) { if (j === 9 || j === 10) {
data.body[i][j] = '\u200C' + data.body[i][j]; data.body[i][j] = '\u200C' + data.body[i][j];
} }
} }
} }
} }
} }
], ],
language: { language: {
search: "_INPUT_", search: "_INPUT_",