473,750 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print web page

May
is it possible to print a web page by using the PrintDocument class?
The thing is that I need to print out some data in a nice format if
possible, to a client's default printer. I got the printing part
working. But I want to format the page first before it prints. I want
to create a web page to gather all data in a table and print out the web
page. So what I see is what the client gets. I don't know how to print
a web page by using System.Drawing. Printing. Currently, I put all data
into stream and use PrintPageEventH andler to format the output by
reading from stream. But I want to format the data into a table on a
web page and print out the page. Please let me know if anyone knows.

--
Direct access to this group with http://web2news.com
http://web2news.com/?microsoft.publi...amework.aspnet
Nov 17 '05 #1
1 5621
You seem to having mixed up client-side and server-side code. Server-side code can perform on the server only. So if you want to print your web page on the server machine, ASP.NET will perfectly help you... However, you can't do anything on the client using server-side code. If you need to print something on the client, use - as the name suggests - client-side code, like JavaScript.

HTH,
Axel Dahmen

--------------------------
"May" <me************ *********@web2n ews.net> schrieb im Newsbeitrag news:48*******@ web2news.com...
is it possible to print a web page by using the PrintDocument class?
The thing is that I need to print out some data in a nice format if
possible, to a client's default printer. I got the printing part
working. But I want to format the page first before it prints. I want
to create a web page to gather all data in a table and print out the web
page. So what I see is what the client gets. I don't know how to print
a web page by using System.Drawing. Printing. Currently, I put all data
into stream and use PrintPageEventH andler to format the output by
reading from stream. But I want to format the data into a table on a
web page and print out the page. Please let me know if anyone knows.

--
Direct access to this group with http://web2news.com
http://web2news.com/?microsoft.publi...amework.aspnet


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
5734
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want that when the user press the print button in the browser , it print automatically the pdf file and not the html page. To do that I insert at the top of my page: <link media="print" rel="alternate" href="printthepage.pdf"> But it do not work and...
3
1624
by: Umut Tezduyar | last post by:
In the msdn.microsoft.com/library most of the articles have an "print" option. But the "print" button is different from the javascripts "window.print()" method. It postpacks the page and then invokes the window.print () method. I couldn't found out the way it works. I need to do something like this, can any body help me? Also, i got a collection, and i want to print each of the items in the collection to a seperate page. If i do it with...
0
1480
by: Paco Ferre | last post by:
Hello, I founded some examples of WebControl printing in internet and tryed to have them working for a DataGrid, something not very complicated. I have a page, Page1.aspx with a DataGrid (paginated) that i want to get alone in page Print.aspx not paginated. Both pages will have the same CSS file so they will look identical except of the paginating.
16
9378
by: Neal | last post by:
Hi, I saw the VB6 Code to do this at this link: http://www.dotnet247.com/247reference/msgs/11/56581.aspx The VB6 Code reads as follows: Private Type Rect Left As Long
1
5717
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
22
130360
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the document and closes it with the following code: <body onload="window.print(); window.close();"> This works correctly (or at least the way I expect it to work under MS Internet Explorer, but it cuases Netscape to "crash"
0
1639
by: ShaneO | last post by:
There have been similar questions raised in the past, however no answers seem to have been provided, so I thought I'd give it a go. Scenario 1: My Windows Forms app generates (say) 10 pages in a Print Preview Control. These pages are made up of varying sized graphics and text, therefore each page is unique but does rely on the content of the previous page to determine the final page layout. My User wants to print ALL pages, pages 1 &...
4
2855
by: CSharpguy | last post by:
My web app is using master pages, On the content page I'm using a GridView. I need to print my GridView and I need to exclude the HyperLink columns. How can I print my content page and exclude the first 3 rows in my Grid due to they are links and I don't need to print the links out?
6
3474
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page and not show the templated fields, (hyperlinks) and also not print those fields?
2
3024
by: bob | last post by:
Hi, I have a page that has a collection of things which it passes to a second 'print' page using a session variable. The print page has buttons for moving though the collection and the user prints by using the browser print button then moves to the next one in the session collection. All very tedious but I know no better.
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9575
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6803
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6080
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4712
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.