so i opened a new window and it will popup the window.print() stuff and i want the window to close i have to exit the window ( not closing it ) and click the tab then take a few second or less to close. This is my coding:
<script type="text/javascript">
function printreport(){
setTimeout(function () { window.print(); }, 500);
window.onfocus = function () { setTimeout(function () { window.close(); }, 500); }
}
printreport();
</script>
I want the output after do the print stuff (after close by clicking save, cancel or X) then automaticly closes the window that i want to print. And i used chrome.