Printing part of the page

Patidar.shekhar
Posted by in .NET Framework category on for Beginner level | Views : 3495 red flag

Printing part of the page.

function printPartOfPage(Div)
{


 var printContent = document.getElementById(Div);
 
 var windowUrl = 'about:blank';
 var uniqueName = new Date();
 var windowName = 'Print' + uniqueName.getTime();
 var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

 //document.getElementById("button").style.visibility="hidden";

 printWindow.document.write(document.getElementById("table").innerHTML);
 printWindow.document.write(printContent.innerHTML);
 printWindow.document.close();
 printWindow.focus();
 printWindow.print();
 printWindow.close();
 
 document.getElementById("button").style.visibility="visible";

 return false;


}

Page copy protected against web site content infringement by Copyscape

About the Author

Patidar.shekhar
Full Name: Shekhar Patidar
Member Level: Starter
Member Status: Member
Member Since: 9/25/2008 1:30:38 AM
Country:

http://www.dotnetfunda.com

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)