473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Print the window without opening Printer Dialogue Box

Hi All,

In javascript i am using the code window.print().
It opens the printer dialogue box and user has to confirm.
I need the code to print the page directly without promoting Printer Dialogue Box.

Thanking you,
Dec 5 '07 #1
3 2601
acoder
16,027 Expert Mod 8TB
This is not possible with JavaScript. You may be able to use ActiveX/vbscript, but that would be an IE-only solution which wouldn't work in other browsers.
Dec 5 '07 #2
This is not possible with JavaScript. You may be able to use ActiveX/vbscript, but that would be an IE-only solution which wouldn't work in other browsers.
Thank you very much for your solution.

Can you send me the proper code on vbscript which will do this functionality (Working only in IE is fine).
Dec 6 '07 #3
acoder
16,027 Expert Mod 8TB
Try something like:
Expand|Select|Wrap|Line Numbers
  1. var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  2. document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  3. WebBrowser1.ExecWB(6, -1);
  4. WebBrowser1.outerHTML = "";
Note: this assumes IE only. I'm not too sure about the exact settings for the ExecWB method. You could try other numbers if the above doesn't work.
Dec 6 '07 #4

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

Similar topics

2
by: Piyush | last post by:
Hi, I need to print stuff on the default printer on the click of a button without opening the print box opening up. Any pointers?
5
by: Alan | last post by:
While not rs.eof <td><%=rs("InvoiceNo")%></td> <td><%=rs("Name")%></td> <td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td> <td>Print this invoice</td> rs.MoveNext Wend Now...
5
by: Jim Ciotuszynski | last post by:
Does anybody know of a way to print a PDF on a clients browser without opening the activeX PDF viewer (that is if the client has it installed. TIA, Jim
4
by: rom | last post by:
I need to print a html table when the user clicks on a key. the problem is that i don't want the printer dialog box to appear. i guess this is impossible in javascript so i think to create an...
1
by: ccherlet | last post by:
I'm trying to create a print link that sends the page to the printer without opening the print dialog box on the browser. I know that window.print() will open the print dialog and then the user...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
1
by: Scott | last post by:
Hello- I have a contol button on a form that I want to code to open a report (rptReviews), then display the print dialogue box so that users can select a printer. This report needs color, but...
0
by: EricJudge06 | last post by:
We are converting some reports from Crystal Reports to Microsoft SQL Reporting Services (SSRS) in an ASP 2.0 VB.Net web app. Crystal had a function called PrintToPrinter which was being used to...
10
by: Snoopy33 | last post by:
I have a DB that I developed on access XP (2002) and deployed over a year ago. No one has had problems printing any of the reports within the DB until we started loading 2007 on new computers. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.