By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 802 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Printing in ASP.Net (Client/Server side)

P: n/a
ap
Hi, It is a quick question...

Is that impossible to print the page(Web Form .aspx file) in client side
using GDI+ like

PrintDocument pd = new PrintDocument();
pd.print();

As I know it is a server side printing... and is that possible to make it
to client side printing or it must be printed using javascript??

Thank you so much

AP
Nov 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
With HTML output, you do not have much control on how things are printed
(JavaScript will not help much in that regard). You are for the most part
at the will of the web browser. If you want more control, then send the
output as PDF document as one example.
--
Peter O'Reilly
Nov 18 '05 #2

P: n/a
ap
"Peter O'Reilly" <Pe***********@timeinc.com!N!O!.S!P!AM!> wrote in message news:<OX*************@tk2msftngp13.phx.gbl>...
With HTML output, you do not have much control on how things are printed
(JavaScript will not help much in that regard). You are for the most part
at the will of the web browser. If you want more control, then send the
output as PDF document as one example.

Is the PDF generated in server side and send it back to the client side to print???
Nov 18 '05 #3

P: n/a
> Is the PDF generated in server side and send it back to the client side to
print???

Yes, correct. You need a third party tool to create the Portable Document
Format (PDF) file. One place to start is Adobe software.
--
Peter O'Reilly
Nov 18 '05 #4

P: n/a
i saw some additional printing software from www.smartertrader.net called
print manager seemed like it could be useful. i think it worked with
crystals pdfs. that may help you
"ap" <af********@hotmail.com> wrote in message
news:36**************************@posting.google.c om...
Hi, It is a quick question...

Is that impossible to print the page(Web Form .aspx file) in client side
using GDI+ like

PrintDocument pd = new PrintDocument();
pd.print();

As I know it is a server side printing... and is that possible to make it
to client side printing or it must be printed using javascript??

Thank you so much

AP

Nov 18 '05 #5

P: n/a
In article <36**************************@posting.google.com >, ap
<af********@hotmail.com> writes
As I know it is a server side printing... and is that possible to make it
to client side printing or it must be printed using javascript??


Sorry for late respone....

There was a method of server side printing to a shared printer in a
domain in ASP that used WSH to achieve its result. I've long ago lost
the details, but wondered if there was anything similar in .Net? What I
want to achieve is for a user to be able to enter some details of a
received item and have a ticket/docket print out to attach to the item.
The printer will be attached to a print server (jet direct type) on the
network (Intranet)

P.
--
Paul
Nov 18 '05 #6

P: n/a
You can print whatever custom information you want, including text
from controls, using javascript. You can open up a window with
javascript from the ASP.Net Page. Write what you want to print to the
window. Then have a link to print that window. Add the javascript into
the head on the ASP.NET page in the design view's HTML tab.

<script language =javascript>
function PrintResults()
{
var sOption="toolbar=yes,location=no,directories=yes,m enubar=yes,";
sOption+="scrollbars=yes,width=750,height=600,left =100,top=25";

var sWinHTML = document.getElementById('MyTextBox').innerHTML;

var winprint=window.open("","",sOption);
winprint.document.open();
winprint.document.write("<HTML><Head></Head><Body>")
winprint.document.write("<a href='javascript:;'
onClick='window.print();return false'>Print This Page.</a><br>");
winprint.document.write(sWinHTML);
winprint.document.write("</Body></HTML>")
winprint.document.close();
winprint.focus();
}
</script>

Paul <pa**@hotmail.com.invalid> wrote in message news:<zx**************@eyeore.home>...
In article <36**************************@posting.google.com >, ap
<af********@hotmail.com> writes
As I know it is a server side printing... and is that possible to make it
to client side printing or it must be printed using javascript??


Sorry for late respone....

There was a method of server side printing to a shared printer in a
domain in ASP that used WSH to achieve its result. I've long ago lost
the details, but wondered if there was anything similar in .Net? What I
want to achieve is for a user to be able to enter some details of a
received item and have a ticket/docket print out to attach to the item.
The printer will be attached to a print server (jet direct type) on the
network (Intranet)

P.

Nov 18 '05 #7

P: n/a
In article <2c*************************@posting.google.com> , Howard
Rothenburg <hr******@bcpl.net> writes
You can print whatever custom information you want, including text
from controls, using javascript. You can open up a window with
javascript from the ASP.Net Page. Write what you want to print to the
window. Then have a link to print that window. Add the javascript into
the head on the ASP.NET page in the design view's HTML tab.


Again sorry for late response.... I've been away.

Thanks for the advice and code snippet.

--
Paul
Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.