Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Preview function and frames 1

Status
Not open for further replies.

sharapov

MIS
May 28, 2002
106
US
Hello,

I know that I can use the following function to initiate a "Print Preview" function in IE6, but is it posible to use the same function on the frameset. In other words when this function is used on the pages with frames it shows the whole frameset. Is it possible to "Print Preview" just on page of the frameset and not the whole thing?

Here is the function:

function printpr()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID=&quot;WebBrowser1&quot; WIDTH=0 HEIGHT=0 CLASSID=&quot;CLSID:8856F961-340A-11D0-A96B-00C04FD705A2&quot;></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = &quot;&quot;;
}
 
Well, the aplication I am writing is for Intranet, so I don't care about any other browsers beside Internet Explorer. Besides 98% of all users around the world are using Internet Explorer anyway!!!
 
sharapov,

Kicking people while they are down is not ethical thinking.

Microsoft so far got their browsers ahead of the game unethically.

Now just because they rule the desktop doesn't mean you should lock others out.

The Internet Explorer only features you are adding in to your Intranet will seriously lock you in to costly Microsoft products.

If instead of using MS-only features (that are just fluff if you ask me, print preview is available in the normal File > Print preview menu options) you stuck to standard compliance you would have more options available to you if your company wished to move away from MS products eventually.

I'm currently building an intranet and one of the things I'm making sure is that Mozilla works great with it and that standards are respected. It turns out that the intranet and it's openess allows us to win a few contracts because of it's openess to standards. A new client wants to use our platform with a mac! No problem! A linux box! No problem! Another OS we never heard about that runs a standard compliant browser! No problem!

It's better than the &quot;Sorry you'll need Windows to use our application&quot;.

Gary Haran
==========================
 
xutopia,

I value your opinion, but I'll stick with Microsoft!
 
sharapov,

An IE6 print preview for a framset already supplies a select box from which you may choose. &quot;As laid out on screen&quot; or &quot;all frames individually&quot;.

Clive
 
Well, first of all this method doesn't work on &quot;iframes,&quot; second I need to start print preview when client clicks on the custom button.
 
I've never tried this, but I have 3 ideas you could try.

1. Before printing, you could try using JavaScript to adjust the width and height of the frames you don't want to see to zero.

2. You could try using style sheets to hide the frames you don't want to see..
<link href=&quot;default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;>
<link href=&quot;print.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot;>
<frameset ...>
<frame name=&quot;nav&quot; class=&quot;hideOnPrint&quot; ...>
<frame name=&quot;main&quot; ...>
</frameset>
In print.css put:
.hideOnPrint{display:none}

3. You could open the frame in a new window and print from there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top