Wrox Programmer Forums
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 17th, 2007, 12:24 AM
Registered User
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default help for printing in ASP.NET


How can I print payslip of each employee from my payroll system. I want to print all the payslips one-after-another (1:1 page) after clicking a button to start printing.

How can I print a webpage without invoking the PrintDialog option. I want to print the page, directly on the default printer after I click the Print button

Pls help me

Old July 17th, 2007, 12:38 AM
Authorized User
Join Date: Jul 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts

Ideally you wont be able to access the default printer of a user (using your web-application), as that is something like hacking. You would need the user's permission for this.

 In order to make printouts on the user's computer, its better to create a Windows based application, that a user may download from your website. The windows based application once installed on the local machine would be capable of printing your reports. The Windows application may be synced to your web server to access the reports.



Old August 13th, 2007, 03:37 AM
Registered User
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ninethsense Send a message via Yahoo to ninethsense

Use window.print() of JavaScript.

<A HREF="javascript:window.print()">Click to Print This Page</A>.

Old August 13th, 2007, 05:15 AM
Friend of Wrox
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403

Yeah, using window.print you can print the page. If you want to print only the part of the page, put that part in div, say its id is divPrint. Use following javascript for printing the content in div element:

var prtContent = document.getElementById(divPrint);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing in ASP.NET through DataGrid agro_menon Pro VB Databases 0 July 16th, 2007 01:02 AM
PRINTING DATA GRID IN ASP.NET akhilvira General .NET 5 January 18th, 2007 04:38 AM
ASP.NET 2.0 Printing Excel Files lagyossarian ASP.NET 2.0 Basics 0 April 10th, 2006 08:58 AM
printing datagrid on asp.net pages sajid C# 0 March 8th, 2005 11:44 AM
printing from asp.net user1 Crystal Reports 0 January 3rd, 2005 02:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.