Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 10th, 2005, 08:05 AM
Authorized User
Join Date: Apr 2004
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;

                    g.DrawString("dinesh Rana",messagefont,Brushes.Black,1,i);
                    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
Old June 28th, 2005, 05:22 AM
Friend of Wrox
Join Date: Sep 2004
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts


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

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