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