${tableHTML}
${warningsHTML ? `` : ''}
COT Report Analysis - ' + market + ' ');
printWindow.document.write(pdfContent);
printWindow.document.write('');
printWindow.document.close();
printWindow.focus();
setTimeout(() => { printWindow.print(); }, 250);
} else {
alert('Could not open print window. Please check your browser pop-up settings.');
}
});
// Clear errors on input focus
[totalOIInput, ncLongInput, ncShortInput, commLongInput, commShortInput, nrLongInput, nrShortInput].forEach(inputEl => {
if (inputEl) {
inputEl.addEventListener('focus', function() {
const errorElId = `cot${this.id.substring(3)}Error`; // e.g. cotTotalOIError
const errorDisplay = document.getElementById(errorElId);
if (errorDisplay) errorDisplay.textContent = '';
if (inputValidationSummary) inputValidationSummary.style.display = 'none'; // Clear general summary too
});
}
});
});
Notices:
${warningsHTML}Generated on: ${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}
`; const printWindow = window.open('', '_blank'); if (printWindow) { printWindow.document.write('