Friday, May 20, 2011

Javascript printout function

<script language="javascript" type="text/javascript">

function Clickheretoprint()

{

var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";

disp_setting+="scrollbars=yes,width=450, height=auto, left=0, top=1";

var content_vlue = document.getElementById("in_print").innerHTML;



var docprint=window.open("","",disp_setting);

docprint.document.open();

docprint.document.write('<html><head><title>Untitled Page</title>');

docprint.document.write('</head><body onLoad="self.print()"><center>');

docprint.document.write(content_vlue);

docprint.document.write('</center></body></html>');

docprint.document.close();

docprint.focus();

}

</script>



<div style="height: auto; margin-left: 75px; margin-top:25px" id="in_print" runat="server">

<p>Add Some more tag and text</p>

<div>

No comments:

Post a Comment