Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function printpage() {
- var data = '<script>alert("Print window");</script><table border="1" cellspacing="0"><tr><td colspan="4">Sample Report</td></tr>' + document.getElementsByTagName('table')[0].innerHTML + '</table>';
- data += '<br/><button onclick="window.print()" class="noprint">Print the Report</button>';
- data += '<style type="text/css" media="print"> .noprint {visibility: hidden;} </style>';
- myWindow = window.open('', '', 'width=800,height=600');
- myWindow.innerWidth = screen.width;
- myWindow.innerHeight = screen.height;
- myWindow.screenX = 0;
- myWindow.screenY = 0;
- myWindow.document.write(data);
- myWindow.focus();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement