Google
Showing posts with label print only select are. Show all posts
Showing posts with label print only select are. Show all posts

Saturday, September 27, 2008

Only selected are print through javascript

Hi friends

If you want to take only selected area print out not whole web page then use the following guidelines and enjoy :-


Take a print are in a single div and any event like onclick , onblur what ever you eant call the below javascript function -


/* function fnPrintArea()
{
var DocumentContainer = document.getElementById('print_table_div_id');
var WindowObject = window.open('', "printarea",
"width=850,height=850,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");
WindowObject.document.writeln(DocumentContainer.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}

*/