473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

new page in C#

Friends,
Coming from VB6 i have problems finding the right methods for printing.
ending a line of text to the printer seems to ask a lot of code in c# while
it was relatiely easy in vb.

How do I in c# :
- Enddoc
- empty line
- endpage
- newPage

Are there any good examples. Maybe a collection of functions, may a class
that has all the goodies in it to do the normal straight forwad printing
stuff.

Hope tat someone can help me

Thanks in advance.

gerrit Esmeijer

Nov 16 '05 #1
3 5757
This link has several articles about printing. It will surely get you started.
http://www.c-sharpcorner.com/Printing.asp

When I had an application that required printing I quickly found out that in .NET you loose a lot of control over printing. I'd love to see an example on how to print just one line at a time to a printer without having to print the entire page.

Enter a piece of data and have that data spit to the printer and then have the printer happily wait for the next piece of data. When say... 55 lines have printed then start a new page. From what I can tell you have to dig down into the Win32 API to make this happen.

--
C Addison Ritchie, MCSD
Ritch Consulting, Inc.
"G.Esmeijer" wrote:
Friends,
Coming from VB6 i have problems finding the right methods for printing.
ending a line of text to the printer seems to ask a lot of code in c# while
it was relatiely easy in vb.

How do I in c# :
- Enddoc
- empty line
- endpage
- newPage

Are there any good examples. Maybe a collection of functions, may a class
that has all the goodies in it to do the normal straight forwad printing
stuff.

Hope tat someone can help me

Thanks in advance.

gerrit Esmeijer

Nov 16 '05 #2
"G.Esmeijer" <ge****@nomail.nl> wrote in
news:41**********************@dreader2.news.tiscal i.nl:
Friends,
Coming from VB6 i have problems finding the right methods for
printing. ending a line of text to the printer seems to ask a lot of
code in c# while it was relatiely easy in vb.

How do I in c# :
- Enddoc
- empty line
- endpage
- newPage

Are there any good examples. Maybe a collection of functions, may a
class that has all the goodies in it to do the normal straight forwad
printing stuff.

Hope tat someone can help me

Thanks in advance.


Rockford Lhotka has two great articles on MSDN in his Adventures in
Visual Basic column. In them, he explores printing and previewing in
the .NET Framework using VB.NET. It should be pretty straight forward
to convert to C#.

Search for The Power of Print and Generating Reports in the .NET
Framework in the MSDN Library.

Dave
Nov 16 '05 #3
Petzold's books Program Windows with C# (VB.NET) have printing examples
showing the basics. You will se a lot of discussion on printing in the
archives of microsoft.public.dotnet.framework.drawing.

Printing is done via a PrintDocument subclass or by just adding an
OnPrintPage handler to the base class.
Basically EndDoc is when you return from the last OnPrintPage call with
HasMorePages = false.
Empty line is done by simply advancing the y coordinate by the linespacing
value.
End Page is when you return from OnPrintPage and NewPage is when
HasMorePages = true at this time.

This is much like printing in the older versions of C++ using a hDC used to
be. You just go to locations on the page and draw things there.

Ron Allen
"G.Esmeijer" <ge****@nomail.nl> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Friends,
Coming from VB6 i have problems finding the right methods for printing.
ending a line of text to the printer seems to ask a lot of code in c# while it was relatiely easy in vb.

How do I in c# :
- Enddoc
- empty line
- endpage
- newPage

Are there any good examples. Maybe a collection of functions, may a class
that has all the goodies in it to do the normal straight forwad printing
stuff.

Hope tat someone can help me

Thanks in advance.

gerrit Esmeijer

Nov 16 '05 #4

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

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
2
by: James | last post by:
I've been to websites where if I navigate off a form, trying to get back to it by hitting the back button gives me a page which says "Warning, page has expired". It doesn't display the page. I've...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
6
by: MooreSmnith | last post by:
When I navigate to the next page using Response.Rediect("MyNextPage.aspx") current page Page_Load event is called. What I may wrongly understood is that post back will happen whenever there is any...
1
by: Lenard Gunda | last post by:
Hi! I have the following problem. From my main page, when someone clicks a button, it uses client side javascript to open another .aspx page. This page displays content, based on what the...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
3
by: Mesut | last post by:
I have written a form in with radio buttons the name is set to orderby and the value is set to KundeVorName and the next value is KundeNachName and it goes so on. I wanna modify my query according...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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...

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.