Personal Work Performance Analyzer

Personal Work Performance Analyzer

Analysis Period

Achievements / Accomplishments

    Completed Tasks (with effort analysis)

      Challenges / Obstacles Faced

        Skills Utilized / Learned

          Self-Identified Areas for Improvement

            Input performance data on the first tab and click "Analyze Performance & View Report".

            `; if (totalEst > 0) { let accuracy = (totalActual / totalEst); let accuracyMsg = ""; if (accuracy === 1) accuracyMsg = "Spot on with estimations!"; else if (accuracy < 1) accuracyMsg = `Generally overestimated tasks by about ${((1 - accuracy) * 100).toFixed(0)}%.`; else accuracyMsg = `Generally underestimated tasks by about ${((accuracy - 1) * 100).toFixed(0)}%.`; reportHTML += `

            Estimation Trend: ${accuracyMsg}

            `; } } else { reportHTML += `

            No completed tasks with effort data logged for this period.

            `; } reportHTML += `
            `; reportHTML += buildListSection("Challenges & Obstacles Faced", "challenges"); reportHTML += buildListSection("Skills Utilized / Learned", "skills"); reportHTML += buildListSection("Self-Identified Areas for Improvement", "improvements"); const reportDisplayEl = document.getElementById('pwpa-performance-report-display'); if(reportDisplayEl) reportDisplayEl.innerHTML = reportHTML; pwpaOpenTab(null, 'pwpa-report'); pwpaUpdateNavButtons(); } // PDF Download function pwpaDownloadPDF() { const reportDisplayElement = document.getElementById('pwpa-performance-report-display'); if (!reportDisplayElement || reportDisplayElement.innerHTML.includes("Input performance data")) { alert("Please analyze performance first."); return; } const startDate = document.getElementById('pwpa-start-date').value; const endDate = document.getElementById('pwpa-end-date').value; let pdfHTML = `

            Personal Work Performance Report

            `; pdfHTML += `

            Period: ${startDate} to ${endDate}

            `; // Get structured content from the display to ensure PDF matches what user sees // Need to ensure CSS classes for tables etc. are handled correctly by html2pdf or inline critical styles const reportContentForPDF = reportDisplayElement.innerHTML .replace(/

            /g, '

            ') // Style H4s .replace(//g, '
            ') .replace(/
            /g, '') .replace(//g, '') .replace(/
              /g, '
                ') .replace(/
              • /g, '
              • '); pdfHTML += reportContentForPDF; const pdfContainer = document.getElementById('pwpa-report-content-for-pdf'); if(!pdfContainer) return; pdfContainer.innerHTML = pdfHTML; // Apply critical styles from CSS variables if html2pdf doesn't pick them up perfectly pdfContainer.querySelectorAll('h4').forEach(el => { el.style.color = getComputedStyle(document.documentElement).getPropertyValue('--dark-color'); el.style.borderBottomColor = getComputedStyle(document.documentElement).getPropertyValue('--primary-color'); }); pdfContainer.querySelectorAll('th').forEach(el => { el.style.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--primary-color'); el.style.color = 'white'; }); const opt = { margin: [0.6, 0.5, 0.6, 0.5], filename: `Performance_Report_${startDate}_to_${endDate}.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true, logging: false, scrollX: 0, scrollY: 0, windowWidth: pdfContainer.scrollWidth }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } }; html2pdf().from(pdfContainer).set(opt).save().then(() => { pdfContainer.innerHTML = ''; }).catch(err => { console.error("Error generating PDF:", err); pdfContainer.innerHTML = ''; alert("An error occurred while generating the PDF. Check console for details."); }); }
                Scroll to Top