TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Joe
NA
1
0
Print out a List of Graphics in C# Windows Form App
Sep 30 2008 9:24 AM
I wrote some C# functions that output a List of System.Drawing.Graphics (List<System.Drawing.Graphics>) objects. they then return the List to a PrintDocument object which I want to have print out each item in the list as a page in a multipage print job. For some reason the first page prints out fine but each successive page comes out blank. Here is my print page event code.
Graphics ReportLayout;
List<Graphics> g = new List<Graphics>();
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<Graphics>
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.
Reply
Answers (
0
)
disable print job notification for all users
How to set font Roman 10cpi in Crystal Reports