469,607 Members | 2,144 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,607 developers. It's quick & easy.

Printing Client side in ASP.NET

Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil

Nov 17 '05 #1
3 2954
Anil,

Because it is a webform, you could use stylsheets (css) for this.
A quick search led me to this site:
http://css-discuss.incutio.com/?page=PrintStylesheets

HTH
Christiaan

<an********@gmail.com> schreef in bericht
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil

Nov 17 '05 #2
an********@gmail.com wrote:
Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil


As Christiaan said, you can use css to specify what content should be
hidden from the printer.
It is not possible to print client-side without that print-dialog, it's a security
feature. Imagine what would happen if some of the "less polite" sites
where able to print anything without you being able to stop it!

Hans Kesting
Nov 17 '05 #3
All you have to do is wrap the fields inside a div tag, then send the div
tag to a client side script and call InnerHTML method of div tag to send to
new window. This is really a client-side scripting issue.

<an********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ryan Moran | last post: by
6 posts views Thread by Darren | last post: by
1 post views Thread by Jurjen de Groot | last post: by
4 posts views Thread by Russ | last post: by
2 posts views Thread by cFleury | last post: by
2 posts views Thread by Jacek | last post: by
2 posts views Thread by Jurjen de Groot | last post: by
18 posts views Thread by Brett | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.