Jwalin Khatri

Print Part of Page

Posted by: jwalin on: December 11, 2008

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;
}

Leave a Reply

Blog Stats

  • 16,458 hits

  • Kingsley Tagbo: Thanks for reading and sharing my article. Have a great like ... Kingsley
  • Bob: Doesn't work with IIS7 (default config on Windows 7 and 2008) because no ADSI anymore.
  • jwalin: Follow the following steps 1]. open you Page in NOTEPAD. 2]. find the tag 3]. Replace the "body" like body oncontextmenu=”return false;" 4]. Sav