473,554 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing in ASP.Net (Client/Server side)

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
7 8419
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
ap
"Peter O'Reilly" <Pe***********@ timeinc.com!N!O !.S!P!AM!> wrote in message news:<OX******* ******@tk2msftn gp13.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
> 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
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********@hot mail.com> wrote in message
news:36******** *************** ***@posting.goo gle.com...
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
In article <36************ **************@ posting.google. com>, ap
<af********@hot mail.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
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="toolba r=yes,location= no,directories= yes,menubar=yes ,";
sOption+="scrol lbars=yes,width =750,height=600 ,left=100,top=2 5";

var sWinHTML = document.getEle mentById('MyTex tBox').innerHTM L;

var winprint=window .open("","",sOp tion);
winprint.docume nt.open();
winprint.docume nt.write("<HTML ><Head></Head><Body>")
winprint.docume nt.write("<a href='javascrip t:;'
onClick='window .print();return false'>Print This Page.</a><br>");
winprint.docume nt.write(sWinHT ML);
winprint.docume nt.write("</Body></HTML>")
winprint.docume nt.close();
winprint.focus( );
}
</script>

Paul <pa**@hotmail.c om.invalid> wrote in message news:<zx******* *******@eyeore. home>...
In article <36************ **************@ posting.google. com>, ap
<af********@hot mail.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
In article <2c************ *************@p osting.google.c om>, 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
24867
by: Brian Hanson | last post by:
Hi, I am trying to programmatically print a pdf file via an asp.net application. I have seen other postings that mention the following code used or something similar to it in a vb.net app. Process.Start("C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe", "/p /h ""C:\Program Files\Adobe\Acrobat 5.0\Help\ENU\ACROBAT.PDF""")
6
3661
by: ccg | last post by:
I am trying to print a file from an ASP script but haven't been able to find any way of making this happen. I have an EPL (Eltron Thermal Printer language) file that is being generated from the script and I want a way to print this file. An EPL file is basically printed the same way as a postscript PRN would be printed. From a command...
3
3210
by: aniljain50 | last post by:
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...
2
6162
by: Ryan Moran | last post by:
Hi, I am writing a ASP.NET application using VB.NET and everything is hunky dorey except for one thing. I am having real problems printing to a printer on the client side. I need to be able to send escape characters to a printer and I was able to do this no problem on the server side with a VB.NET application. however, I have no clue...
6
2281
by: Darren | last post by:
Guys, Based on selection in a datagrid,I need to retrieve info to construct a letter from a table in my database and send it off for printing.Now the thing is there may be a few hundred letters to be printed.How do I accomplish this in ASP.NET Any examples/links would be appreciated
2
3586
by: cFleury | last post by:
Hello, I am new to ASP.NET and I have to print an invoice from an application written in ASP.NET, I have followed most of the threads in this newsgroup about the dificulties posed by the server side nature of ASP.NET, but nobody really addressed a solution to the problem, can I use "Crystal Reports" which comes with Visual Studio to do it ?...
2
1371
by: Jacek | last post by:
I'm developing ASP.NET C# application. I need to implement server-side printing for asp.net form on specified in DB printer. I know how to print it on Client-side (window.print()). How can I print the same page (form) on server side? If I can use PrintDocument class, then how to pass dynamically generated web form. If I have to use...
4
5890
by: Lucas Ponzo | last post by:
Hi All, I have an ASP.NET 2.0 app. The users access the pages, uniquely via pocket pc ... I need to print a page. But I need that the page print on a printer installed on the web server hosting my application. Step 1) The user clicks the Print icon in the web page
18
11268
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I...
0
7812
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7574
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7894
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5442
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5162
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3579
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3561
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1145
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.