Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2005, 08:05 AM
Authorized User
 
Join Date: Apr 2004
Location: Gurgaon, Haryana, India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default Printing in C#

I am tryng to make Reports in C# but i fails to handel the pages. code is below to print on the page
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {

            Graphics g = e.Graphics;
            g.PageUnit =GraphicsUnit.Inch;
            string message ="Dinesh Rana";
            Single leftMargin=e.MarginBounds.Left/100;
            Single rightMargin=e.MarginBounds.Right/100;
            Single topmargin=e.MarginBounds.Top/100;
            Single bottomMargin =e.MarginBounds.Bottom/100;
            Single width=e.MarginBounds.Width/100;
            Single height=e.MarginBounds.Height/100;

            Font messagefont =new Font("Arial",24,System.Drawing.GraphicsUnit.Point) ;
            for(int i =0;i<100;i++)
            {
                e.HasMorePages =false;
                if(i%8!=0)
                {

                    g.DrawString("dinesh Rana",messagefont,Brushes.Black,1,i);
                }
                else
                {
                    e.HasMorePages = true;

                    g.DrawString("kumar dinesh Rana",messagefont,Brushes.Black,1,i);
                }

                currentpage +=1;
            }
        }
        I want after 8 Lines it continues in new page and page are added but in this code either endless pages are added with same data and if i reverse the if condition i get only one page.Can some body help me
Can any body tell from where i get the complete reference of printing in C# it is readly Available for Vb but not for C#.is there any book that can help me

Dinesh Rana


dinesh Rana
__________________
dinesh Rana
Reply With Quote
  #2 (permalink)  
Old June 28th, 2005, 05:22 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: , , India.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.c-sharpcorner.com/Printing.asp

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help about printing Fahim Crystal Reports 0 November 12th, 2006 11:14 PM
Printing Arunachalam Beginning VB 6 2 October 12th, 2006 07:44 AM
Printing uchkid Pro Visual Basic 2005 1 September 7th, 2006 03:37 AM
capturing printing settings when printing reports nikolaosk Access VBA 0 February 8th, 2005 04:14 AM
Printing NiNe ADO.NET 5 April 7th, 2004 04:28 AM



All times are GMT -4. The time now is 08:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.