Torna al Thread
function PrintPreview(ObjToPrint) {
// la funzione accetta un oggetto contenitore per stamparlo con le caratteristiche di stile già presenti nell'oggetto
var myVar = document.getElementById(ObjToPrint).innerHTML;
myWin = window.open("","print_window","status=1,toolbar=1,height=400,width=600,menubar=1");
myWin.blur(); // to remove focus from an object
myWin.document.write('<html><head>');
myWin.document.write('<link rel="stylesheet" type="text/css" media="print" href="StilePrint.css"/>');
myWin.document.write('</head><body>');
myWin.document.write(myVar);
myWin.document.write('</body></html>');
myWin.print();
myWin.document.close();
//myWin.close();
}