Tuesday, August 08, 2006

Print Button For any Web application..

Switch to HTML View.

In the 'head' section of your code, put:
'SCRIPT Language="Javascript"'
function printthis(){
if (NS) {
window.print() ;
} else {
var WebBrowser = '';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
'/script'
In the 'body' section of your code put:
'script Language="Javascript"'
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('
');
}
'/script'
This is working code and applicable at any web application..
Cheers,
D. Nitin

About Me

Software Professional