473,395 Members | 1,938 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,395 software developers and data experts.

Printing from ASP.NET1.1

I'm not sure if this is even possible, but the scenario is this:

I have a web page which will have options for printing different kinds of
form letters (think dropdown list). Once a letter is selected and a "Print"
button is clicked, I need to be able to bring up a Print Dialog to let the
user select a printer. Then, I need to send the print data to the printer.
The catch here is that I don't want to have to show the letters, I would
just like to send the text/html to the printer once the type of letter and
printer has been chosen.

Is this possible? How would I go about doing this?

Thanks!
May 30 '06 #1
2 980
Well, I don't know if there is a way to do what you want using only ASP.NET
(I think you would need something like an ActiveX control or something), but
here is a workaround that uses just ASP.NET and JavaScript. Create another
page that has the following body tag:

<body onLoad="window.print();window.close();">

This page will have the content (and only the content) you want printed.
When the user clicks the print button on the page they selected the form
from, this page will open IN ANOTHER WINDOW. after it opens, they will see
the print dialog, select the printer, and then the window will close,
therefore having the page get printed, but they will never have to manually
open or close the extra window. If you want to go the extra mile, you could
also add JavaScript to make the window as small as possible so that they
don't even notice that another window opened, like the following:

<body onLoad="window.resizeTo(0,0);window.print();window .close();">

This is what I do when I don't want any extra buttons or controls printed
with a page on my site, so you can see how well it works for you. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"karch" <no****@two.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I'm not sure if this is even possible, but the scenario is this:

I have a web page which will have options for printing different kinds of
form letters (think dropdown list). Once a letter is selected and a
"Print"
button is clicked, I need to be able to bring up a Print Dialog to let the
user select a printer. Then, I need to send the print data to the printer.
The catch here is that I don't want to have to show the letters, I would
just like to send the text/html to the printer once the type of letter and
printer has been chosen.

Is this possible? How would I go about doing this?

Thanks!

May 30 '06 #2
Excellent idea...I'll give it a try!

Thanks!

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP04.phx.gbl...
Well, I don't know if there is a way to do what you want using only ASP.NET (I think you would need something like an ActiveX control or something), but here is a workaround that uses just ASP.NET and JavaScript. Create another
page that has the following body tag:

<body onLoad="window.print();window.close();">

This page will have the content (and only the content) you want printed.
When the user clicks the print button on the page they selected the form
from, this page will open IN ANOTHER WINDOW. after it opens, they will see
the print dialog, select the printer, and then the window will close,
therefore having the page get printed, but they will never have to manually open or close the extra window. If you want to go the extra mile, you could also add JavaScript to make the window as small as possible so that they
don't even notice that another window opened, like the following:

<body onLoad="window.resizeTo(0,0);window.print();window .close();">

This is what I do when I don't want any extra buttons or controls printed
with a page on my site, so you can see how well it works for you. Good Luck! --
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"karch" <no****@two.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I'm not sure if this is even possible, but the scenario is this:

I have a web page which will have options for printing different kinds of form letters (think dropdown list). Once a letter is selected and a
"Print"
button is clicked, I need to be able to bring up a Print Dialog to let the user select a printer. Then, I need to send the print data to the printer. The catch here is that I don't want to have to show the letters, I would
just like to send the text/html to the printer once the type of letter and printer has been chosen.

Is this possible? How would I go about doing this?

Thanks!


May 30 '06 #3

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

Similar topics

3
by: Ben Wan | last post by:
I've got Visual studio 2002 (Version 7.0.9466) with .Net 1.0 Framework). How can I upgrade my .Net version to 1.1 without buying the newer Visual Studio (2003)?
2
by: bb | last post by:
i use the losformatter to serialise a hashtable and the store in the database. (i save some urls so they can be reconstructed) we have moved the project from asp.net1 to asp.net2 now whenever...
55
by: Steven Nagy | last post by:
Hi all, Sorry I have no time to test this myself.... Can I add the same attribute to a field twice? Eg. Public string myField;
4
by: hvj | last post by:
I need to run a .NET1.1 program in a .NET2.0 CLR. The .NET1.1 exe starts correctly in .NET2.0. Now I want to debug in Visual Studio 2005. But when I try to open the .NET1.1 project, Visual Studio...
1
by: Rune Jacobsen | last post by:
Hi all, I have some often-performed tasks in my applications that I want users to be able to specify hotkeys for. However, I don't want to hard code these hotkeys, as sooner or later some other...
3
by: Marcus | last post by:
Hi, I converted my .Net1.1 application (written in VS2003) to a .Net2.0 application. I let VS2005 do the job as it suggested when trying to load my VS2003 project in VS2005. I then included the...
4
by: jayfeb29 | last post by:
Hi , Any one can guide me in Import the Excel 2002 data into sql server 2000 using ado.net1.1. I have searched all the forums most of the solutions end with a line of suggestion not with any code...
0
by: jbrooksga | last post by:
Hello, First of all I know nothing about programming. Recently had to install .Net1.1 on my W2K server to support an application I had purchased. The .Net1.1 was installed as part of the...
4
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got an ASP.NET 1.1 application and I need to add to it new Browser Capabilities information for 3 new cellular phones. I used to use...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.