Hedge Fund Compliance Checklist

Hedge Fund Compliance Checklist

(${completedItemsCount} of ${totalItemsCount} items completed)

Detailed Breakdown:

`; for (const tabId in results) { if (Object.hasOwnProperty.call(results, tabId)) { const category = results[tabId]; category.items.forEach((item, index) => { outputHtml += ` ${index === 0 ? `` : ''} `; }); } } outputHtml += `
Category Compliance Item Status
${category.name}${item.name} ${item.completed ? 'Complete' : 'Incomplete'}
`; const resultsOutputDiv = document.getElementById('results-output'); if (resultsOutputDiv) { resultsOutputDiv.innerHTML = outputHtml; } // Show PDF download button const downloadPdfButton = document.getElementById('download-pdf-button'); if (downloadPdfButton) { downloadPdfButton.style.display = 'inline-flex'; } showTab(tabIds.indexOf('results')); // Move to results tab } /** * Handles PDF download. */ function downloadPDF() { const resultsOutputDiv = document.getElementById('results-output'); if (!resultsOutputDiv || resultsOutputDiv.innerHTML.includes('Click \'Generate Report\'')) { showCustomModal('Report Not Generated', 'Please generate the compliance report first before downloading the PDF.'); return; } // Create a temporary container for PDF content to exclude nav buttons and other UI. const pdfContent = document.createElement('div'); pdfContent.innerHTML = `

Hedge Fund Compliance Checklist Report

Generated on: ${new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}

${resultsOutputDiv.innerHTML}
`; // Temporarily hide the main tool container to avoid layout issues during PDF generation complianceChecklistContainer.style.display = 'none'; html2pdf().from(pdfContent).set({ margin: [20, 20, 20, 20], // Top, Left, Bottom, Right filename: 'Hedge_Fund_Compliance_Checklist.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, logging: true, dpi: 192, letterRendering: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } }).save().then(() => { // Restore visibility of the main tool container after PDF generation is complete complianceChecklistContainer.style.display = 'flex'; pdfContent.remove(); // Clean up temporary element }).catch(error => { console.error("Error generating PDF:", error); showCustomModal('PDF Generation Error', 'There was an issue generating the PDF. Please try again.'); complianceChecklistContainer.style.display = 'flex'; pdfContent.remove(); }); } // --- Event Listeners --- if (nextButton) { nextButton.addEventListener('click', handleNextButtonClick); } if (prevButton) { prevButton.addEventListener('click', handlePrevButtonClick); } // Custom modal close button if (modalCloseButton) { modalCloseButton.addEventListener('click', hideCustomModal); } // Close modal if clicking outside (on overlay) if (customModalOverlay) { customModalOverlay.addEventListener('click', (e) => { if (e.target === customModalOverlay) { hideCustomModal(); } }); } // --- Initial Setup --- initializeTabs(); // Populate tabs and content on load showTab(0); // Show the first tab on load });
Scroll to Top