<script type="text/javascript">
function printPreview() {
var windowWidth=850;
var windowHeight=550;
var myleft=(screen.width)?(screen.width-windowWidth)*0.5:100;
var mytop=(screen.height)?(screen.height-windowHeight)*0.5:100;
var feature='left='+myleft+',top='+eval(mytop-50)+',width='+windowWidth+',height='+windowHeight+',';
feature+='menubar=yes,status=no,location=no,toolbar=no,scrollbars=yes';
window.open(window.location+'?print_preview=2','welcome',feature);
}
</script>
<button id="printPreview" onclick="printPreview()">Print Preview</button>