Posts

Showing posts from October, 2010

Welcome to My Blog

Thank you for visiting myPage, I am Varun Sharma, a Software Engineer by profession. I work for a Technology Major; I Design, Develop. This is what I do 9 am to 5 pm Monday to Friday at my workplace.

How to Print a Report made in Web Page

First of all insert the printable area into a Div. then write below code in Page load Suppose your Print button Id = btnPrint and div id = printdiv btnPrint.Attributes.Add("Onclick", "javascript:CallPrint('printdiv');"); pass this div id to the javascipt function written in HTML function CallPrint(strid) { var prtContent = document.getElementById(strid); var WinPrint = window.open('','','letf=0,top=0,width=1000,height=1000,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); prtContent.innerHTML=strOldOne; }