473,769 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print

Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin
Nov 18 '05 #1
6 1835
you dont unless you want to print it serverside, to a serverside printer.
You can prompt the user for printing but you can't force it, unless possibly
you can get them to install a component or such.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin

Nov 18 '05 #2
You can bring the PrintDialog up with some client side script, but you can't
force them to print it.

window.print()

HTH,

bill
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin

Nov 18 '05 #3
Forced printing would breach the security of the browser unless being done
by a signed applet or activeX control of some sort. It would be a spammers
dream.

The best you can do is invoke the print dialogue via javascript and hope
they print.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:#f******** ******@tk2msftn gp13.phx.gbl...
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin

Nov 18 '05 #4
Thanks guys. Can anybody show me the script to show the print dialog?

Thank you.
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin

Nov 18 '05 #5
Try this

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
<html>
<head>
<script language="VB" runat="server">
'Sub Page_PreRender( )

Sub Page_Load( sender as Object,e as EventArgs)

Dim scriptString as String = "<script language=JavaSc ript> function
DoClick() {"
ScriptString += "var truthBeTold = window.print;"
ScriptString += "if (truthBeTold != null)"
ScriptString += "window.print() ;"
ScriptString += "else window.alert('U nfortunately, your browser does
not support this shortcut. Please select File and then Print from your
browsers menu.');}<"
scriptString += "/"
scriptString += "script>"

If(Not IsClientScriptB lockRegistered( "clientScript") )
RegisterClientS criptBlock("cli entScript", scriptString)
End If
End Sub
</script>
</head>
<body topmargin="20" leftmargin="10" >
<form id="myForm" runat="server">
<input type="button" value="ClickMe" onclick="DoClic k()">
</form>
</body>
</html>
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:e0******** *****@TK2MSFTNG P11.phx.gbl...
Thanks guys. Can anybody show me the script to show the print dialog?

Thank you.
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin


Nov 18 '05 #6
Thanks John.

But in this way, the user has to click on the "Click Me" button to display
the print dialog. I want the print dialog to pop up without the user
clicking on anything (at load).
"John Timney (Microsoft MVP)" <ti*****@despam med.com> wrote in message
news:Oh******** ******@TK2MSFTN GP11.phx.gbl...
Try this

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
<html>
<head>
<script language="VB" runat="server">
'Sub Page_PreRender( )

Sub Page_Load( sender as Object,e as EventArgs)

Dim scriptString as String = "<script language=JavaSc ript> function
DoClick() {"
ScriptString += "var truthBeTold = window.print;"
ScriptString += "if (truthBeTold != null)"
ScriptString += "window.print() ;"
ScriptString += "else window.alert('U nfortunately, your browser does not support this shortcut. Please select File and then Print from your
browsers menu.');}<"
scriptString += "/"
scriptString += "script>"

If(Not IsClientScriptB lockRegistered( "clientScript") )
RegisterClientS criptBlock("cli entScript", scriptString)
End If
End Sub
</script>
</head>
<body topmargin="20" leftmargin="10" >
<form id="myForm" runat="server">
<input type="button" value="ClickMe" onclick="DoClic k()">
</form>
</body>
</html>
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:e0******** *****@TK2MSFTNG P11.phx.gbl...
Thanks guys. Can anybody show me the script to show the print dialog?

Thank you.
"Catalin Porancea" <ca************ **@midwestern.n et> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

How do I print a web form as soon as it is displayed, without any user
intervention?

Thank you,
Catalin



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2404
by: Michael Foord | last post by:
Here's a little oddity with 'print' being a reserved word... >>> class thing: pass >>> something = thing() >>> something.print = 3 SyntaxError: invalid syntax >>> print something.__dict__ {}
14
2917
by: Marcin Ciura | last post by:
Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version: $Revision: 0.0 $
0
1832
by: bearophileHUGS | last post by:
There is/was a long discussion about the replacement for print in Python 3.0 (I don't know if this discussion is finished): http://mail.python.org/pipermail/python-dev/2005-September/055968.html There is also a wiki page that collects the ideas: http://wiki.python.org/moin/PrintAsFunction There is the will to keep the printing operation very simple for the most common situation, but at the same time to make it flexible (optional no...
1
5720
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
1
2323
by: Steff | last post by:
I am wandering if my code is making sense... I use a lot the print function. Is it weird in this case where I have to display an array ? I thought it would be better to have the entire array in php but now I am not sure if that makes sense. Can you tell me please ? <html> <head>
3
2109
by: James J. Besemer | last post by:
I would like to champion a proposed enhancement to Python. I describe the basic idea below, in order to gage community interest. Right now, it's only an idea, and I'm sure there's room for improvement. And of course it's possible there's some serious "gotcha" I've overlooked. Thus I welcome any and all comments. If there's some agreement that this proposal is worth further consideration then I'll re-submit a formal document in...
69
3225
by: Edward K Ream | last post by:
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of this pep would be to make it impossible to use the name 'print' in a backward compatible manner. Indeed, if a program is to compile in both Python 2.x and Python 3.x, the print function (or the print statement with parentheses) can not use the...
2
22123
by: Brad Pears | last post by:
I have some sample code that uses the print dialog, print preview and a print direct options. If I select print preview and then click the printer icon from that, the document prints. If I select the print directly option, it also prints right away to the defauilt printer. However, if I use the printer dialog control to print and I click 'OK' to actually print the document - nothing happens. The job does not even go into the print...
7
10761
by: samslists | last post by:
Am I the only one that thinks this would be useful? :) I'd really like to be able to use python 3.0's print statement in 2.x. Is this at least being considered as an option for 2.6? It seems like it would be helpful with transitioning.
12
3540
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to print the report three times, but do not know how
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.