Jump to content

print preview problem


raefy2

Recommended Posts

i have the problem about the script below.... i used localhost it running well... but after go to the prodcution....i have the problem with preview..it cant show as same like word printpreview.. it active x control bar and page not preview not fit... i think it because of linux based server i have used... pleasehelp me or email to my email raefy2r@hotmail.com

 

<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').innerHTML;

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.display='';

 

document.body.insertAdjacentHTML('beforeEnd',WebBrowser);

WebBrowser1.ExecWB(OLECMDID, PROMPT);

WebBrowser1.outerHTML = "";

 

document.getElementById('schedule').style.display='';

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

}

</script>

Link to comment
Share on other sites

Try This:

 

<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').innerHTML;
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.display='';

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

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

<a href="javascript:printpreview()">Print Preview</a>

<div id="schedule"></div>
<br>
<div id="popup_schedule"></div>
<br>
<div id="beforeEnd"></div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.