Bug #3019
Fitur Export Hanya PDF di Menu ESS Payslip
Start date:
08/26/2024
Due date:
% Done:
0%
Estimated time:
Description
Sebelumnya Fitur export ada semua file type ( pdf, excel, word, csv dll.) sesuai dengan setting reporting service, berikut update supaya khusus menu ess payslip, export nya hanya pdf saja
UPDATE FILE PACKAGE
C:\Webserver\Easy\UI\app\controller\report\custom.rdlreport.js
UPDATE SCRIPT
setelah unmask di function view report, kasih function checkIframeContent (pnlReport), dan ubah time jadi 3000
// Function to check iframe content and modify export options
function checkIframeContent(pnlReport) {
var iframe = pnlReport.el.down('iframe').dom;
if (iframe) {
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
if (iframeDocument) {
var exportSelect = iframeDocument.getElementById('ReportViewer1_ctl01_ctl05_ctl00');
if (exportSelect) {
var options = exportSelect.options;
for (var i = options.length - 1; i >= 0; i--) {
var value = options[i].value;
// Remove all options except "Select a format" and "PDF"
if (value !== 'Select a format' && value !== 'PDF') {
exportSelect.remove(i);
}
}
// Ensure that dropdown functionality remains
// Re-trigger change event to ensure it updates properly
var event = document.createEvent('HTMLEvents');
event.initEvent('change', true, false);
exportSelect.dispatchEvent(event);
} else {
// Retry if exportSelect is not found
setTimeout(function() {
checkIframeContent(pnlReport); // Retry
}, 500); // Retry every 500ms
}
} else {
// Retry if iframeDocument is not yet available
setTimeout(function() {
checkIframeContent(pnlReport); // Retry
}, 500); // Retry every 500ms
}
} else {
// Retry if iframe is not yet available
setTimeout(function() {
checkIframeContent(pnlReport); // Retry
}, 500); // Retry every 500ms
}
}
Files