Printing Datagrids in ASP.net
-
Hi All, I have some ASP.Net web pages that use C# as code behind. On those ASPX pages, there r some datagrids that I want to print. I have seen help about printing datagrids on standalone applications but dont know how to do it on WebBased applications such as mine. Any help/ideas/urls wud be greatly appreciated Thanx Umashanker.k
-
Hi All, I have some ASP.Net web pages that use C# as code behind. On those ASPX pages, there r some datagrids that I want to print. I have seen help about printing datagrids on standalone applications but dont know how to do it on WebBased applications such as mine. Any help/ideas/urls wud be greatly appreciated Thanx Umashanker.k
Try the below mentioned code:- function CallPrint(strid) { var prtContent = document.getElementById(strid); var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); prtContent.innerHTML=strOldOne; }
..... ..... .....
:)