Meeting Time Effectiveness Tracker

Meeting Time Effectiveness Tracker

Overall Settings


Meeting Entries

Please enter meeting data in the 'Data Entry' tab and click "Process Data & View Report" to generate the report.

No meeting data entered. Please add meetings in the 'Data Entry' tab.

`; mteOpenTab(null, 'mte-report'); mteUpdateNavButtons(); // Update buttons to reflect state (PDF button should hide) return; } const avgEffectiveness = (totalEffectivenessScore / numMeetings).toFixed(1); const avgAttendees = (meetingsData.reduce((sum, m) => sum + m.attendees, 0) / numMeetings).toFixed(1); const avgActualDuration = (totalActualDuration / numMeetings).toFixed(0); let reportHTML = `

Meeting Effectiveness Report

Overall Summary

Total Meetings: ${numMeetings}
Total Scheduled Time: ${mteFormatDuration(totalScheduledDuration)}
Total Actual Time Spent: ${mteFormatDuration(totalActualDuration)}
Overall Time Variance: ${mteFormatDuration(totalActualDuration - totalScheduledDuration)}
Total Estimated Cost: ${mteFormatCurrency(totalCost)}
Average Effectiveness: ${avgEffectiveness} / 5
Total Actions/Decisions: ${totalActionItems}
Meetings Over Time: ${meetingsOverTime} (${((meetingsOverTime/numMeetings)*100).toFixed(0)}%)
Meetings Under Time: ${meetingsUnderTime} (${((meetingsUnderTime/numMeetings)*100).toFixed(0)}%)
Meetings On Time: ${meetingsOnTime} (${((meetingsOnTime/numMeetings)*100).toFixed(0)}%)
Avg. Attendees: ${avgAttendees}
Avg. Meeting Duration: ${mteFormatDuration(avgActualDuration)}

Detailed Meeting Data

`; meetingsData.forEach(m => { let varianceClass = ''; if (m.timeVariance > 0) varianceClass = 'color:var(--danger-color); font-weight:bold;'; if (m.timeVariance < 0) varianceClass = 'color:var(--success-color); font-weight:bold;'; reportHTML += ` `; }); reportHTML += `
Title Date Scheduled (min) Actual (min) Variance (min) Attendees Cost Effectiveness (1-5) Actions
${m.title} ${m.date || 'N/A'} ${m.scheduledDuration} ${m.actualDuration} ${m.timeVariance} ${m.attendees} ${mteFormatCurrency(m.cost)} ${m.effectiveness} ${m.actionItems}
`; document.getElementById('mte-report-content').innerHTML = reportHTML; mteOpenTab(null, 'mte-report'); // Switch to report tab mteUpdateNavButtons(); // Update buttons (PDF button should show now) } function mteDownloadPDF() { const reportContentElement = document.getElementById('mte-report-content'); if (reportContentElement.innerHTML.includes("Please enter meeting data")) { alert("Please generate a report first before downloading the PDF."); return; } // Clone the report content for PDF to apply PDF-specific styles without affecting the on-screen display const pdfContentClone = reportContentElement.cloneNode(true); const pdfContainer = document.getElementById('mte-report-content-for-pdf'); pdfContainer.innerHTML = ''; // Clear previous pdfContainer.appendChild(pdfContentClone); // Ensure all elements inside the clone that are meant for PDF are visible, and others hidden // (This is mostly handled by CSS, but JS can do specific manipulations if needed) const opt = { margin: [0.5, 0.5, 0.5, 0.5], // inches: top, left, bottom, right filename: 'Meeting_Effectiveness_Report.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true, logging: false }, // UseCORS if images are external jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } // Handle page breaks }; // Use the specially prepared container for PDF generation html2pdf().from(pdfContainer).set(opt).save().then(() => { pdfContainer.innerHTML = ''; // Clean up clone after PDF generation }).catch(err => { console.error("Error generating PDF:", err); pdfContainer.innerHTML = ''; // Clean up clone on error alert("An error occurred while generating the PDF. Please check the console for details."); }); } // Initialize document.addEventListener('DOMContentLoaded', () => { mteAddMeetingRow(); // Add one meeting row by default mteUpdateNavButtons(); mteOpenTab(null, 'mte-data-entry'); // Ensure correct tab is active visually });
Scroll to Top