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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing

Status
Not open for further replies.

nevets2001uk

IS-IT--Management
Jun 26, 2002
609
GB
I'm not sure if this is possible in ASP.NET but I have a page that displays a printable report of some data.

Currently I have a link to this page, which opens in a new window and the user must manually print the page and close the window.

Is there a way to automate this in .NET. On page_load I'd like to automatically print the page to the default printer (preferably without user intervention) and then automatically close the window. I have read about the .PRINT method but cannot figure out how it can be used to print a page.

If any part of the above can be achieved I'd be very happy!


Steve G (MCP)
 
You can't do it without user confirmation. Imagine the sort of stuff that would be sent to your printer if it was possible...


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
OK thanks. Is there a way to get a page to start the print process on load and dislpay the printer select dialog box automatically?

Also if this can be done is there a way to automatically close the page after the page is spooled?


Steve G (MCP)
 
window.print" will raise the browsers print option. These are all javascript methods though so if you need any further help you'll be best off asking in that forum.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks for your help. I got this working pretty much as I wanted it by using

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


Steve G (MCP)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top