By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,619 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

print preview not working

P: 2
<script>
function printpreview()
{


var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var mydoc = document.getElementById('popup_schedule').innerHTM L;
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" ></OBJECT>';

document.getElementById('schedule').style.display= 'none';
document.getElementById('popup_schedule').style.di splay='';

document.body.insertAdjacentHTML('beforeEnd',WebBr owser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";

document.getElementById('schedule').style.display= '';
document.getElementById('popup_schedule').style.di splay='none';
}
</script>


From that script above i want to prinpreview. in localhost (window) it working but after i used server(linux) to run application it not working properly. i think because server based problem.. so i need help to settle this problem...
Jun 21 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

This seems like a permissions/security issue. This code for a start will only work in IE. You will have most probably have to change your security properties for this to work.
Jun 21 '07 #2

P: 2
what u mean change the security.... u mean all computer user that used application must change...cant rite... i think becoz server based.... when used in localhost it working to print preview like word... but after production the applicavtion in server..it not working..just popup with activex waning

Welcome to TSDN!

This seems like a permissions/security issue. This code for a start will only work in IE. You will have most probably have to change your security properties for this to work.
Jun 22 '07 #3

acoder
Expert Mod 15k+
P: 16,027
what u mean change the security.... u mean all computer user that used application must change...cant rite... i think becoz server based.... when used in localhost it working to print preview like word... but after production the applicavtion in server..it not working..just popup with activex waning
Yes, that is what will happen. In localhost, it works because the security settings are more relaxed. When anyone visits the website, it will popup an ActiveX warning. Only if they allow the ActiveX possibly with a change in the security will your code run and that only in IE.
Jun 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.