Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

document.print without dialog box

Posted on 2004-10-04
7
Medium Priority
?
285 Views
Last Modified: 2011-10-03
I'm trying to use the document.print() function in order to automatically print a report page on load.

It works fine except that the Print dialog box comes up.

I'd like to know how I can get around so that the page would simply be printed without ANT user interaction.

I'm only interested in knowing how this can be done with IE. Thsis does not have to be compatible with any other browsers.

VERY URGENT!!!
0
Comment
Question by:zsoltvincze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 

Author Comment

by:zsoltvincze
ID: 12220489
Tried the posted article but it does not seem to work.  I tried both valuef of "1" and "2"

Can I get some more instructions about it?

My html is here:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>


<SCRIPT LANGUAGE=JavaScript>
function jprint()
{
        VBPrint();
}
</SCRIPT>

<object id=WBControl width=0 height=0 classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></object>
<SCRIPT LANGUAGE=VBScript>
        Sub VBPrint() On Error Resume Next
        WBControl.ExecWB 6,2
        End Sub
</SCRIPT>


<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE></TITLE>
</HEAD>
<BODY onload="jprint()">
ok
</BODY>
</HTML>

0
 
LVL 33

Accepted Solution

by:
sajuks earned 1000 total points
ID: 12223556
//try this
<html>
<head>
<script language="javascript1.2">
function print() {
    self.focus();
    document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0   classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
    idWBPrint.ExecWB(6, -1);
    idWBPrint.outerHTML = "";
}
-->
</script>
</head>
<body onload="print()">
hello world
</body>
</html>



0
 

Author Comment

by:zsoltvincze
ID: 12225256
Brings up the dialog just as well.

does it not when you open it?
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12233837
not in mine.ie 6 and w2k server
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question