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.
I wound up going with a PrintPreview dialog box and writing everything in the OnPaint event.
Once that was done, I completely ditched the form. One PrintPreview that actually serves as the form for my Clients to view before going straight to the printer.
FYI: Positioning every item on the page was tedious.