Thursday, December 30, 2010

javascript print function

function printbyid(sId) {
var oPrn = document.getElementById(sId);
var oWin = window.open('', "quickprint");
oWin.document.writeln(oPrn.innerHTML);
oWin.document.close();
oWin.focus();
oWin.print();
oWin.close();
}

< div id="sprint" >
....
< / div >

< input type="button" value="Printeaza Raport" onclick="printbyid('sprint');" / >

No comments:

Post a Comment