Graphics ReportLayout;
List
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
ReportLayout = e.Graphics;
float leftMargin = e.MarginBounds.Left / 100;
float rightMargin = e.MarginBounds.Right / 100;
float topMargin = e.MarginBounds.Top / 100;
float bottomMargin = e.MarginBounds.Bottom / 100;
float width = e.MarginBounds.Width / 100;
float height = e.MarginBounds.Height / 100;
//Make Pages only once
if (pagesmade == false)
{
//returns a List
g = RT.WriteReport(e);
pagesmade = true;
}
//if pages remain there are more pages to print
if (iterate < g.Count-1)
{
e.HasMorePages = true;
}
else
{
e.HasMorePages = false;
}
ReportLayout = g[iterate];
iterate++;
}
I'm kind of at a loss any suggestions would be greatly appreciated.
Replies
Know the answer? Post it — somebody with the same question will find it here.