Painting to Form then to Printer
Posted
by
jp2code
on Stack Overflow
See other posts from Stack Overflow
or by jp2code
Published on 2011-02-14T20:27:50Z
Indexed on
2011/02/14
23:25 UTC
Read the original article
Hit count: 301
I often find myself needing to create custom reports that do NOT work with Crystal Reports or Report Viewer. Often, I hack a DataTable together and dumping that into a DataGridView control. It is never pretty, and printing is difficult.
What I need is a class that I can call using the OnPaint event, but I've never sat down and written all of the Pen and Brush commands until now.
Painting to the screen and painting to a printer both use the Graphics object, so I want to build a class that I'd pass in the Graphics object, my window bounds (a Rectangle), and some data (in the form of an instance of my class) that I'd use to paint a form or a sheet of paper.
That sounds like a great concept!
Surely, someone has done something like this before.
Does anyone know of a book, a website tutorial, or video that goes into this?
If someone wants to write all that out for me here, more power to you - but I'd think that would be too much work.
© Stack Overflow or respective owner