In This Chapter:
Over the years, I've written a lot of software that saves statistical information to a database. Right now I'm maintaining some Internet filtering software, and the recorded statistics are an essential part of the application. There's one catch, though. Staff from the human resource department are the ones who need to see the statistics. There is a wide chasm between what technical types, such as network administrators, and the human resources staff can tolerate in terms of document formats. Text-based reports, lists of URLs, and data without explicit relationships just don't cut it outside the realm of IT professionals.
For this reason, I created a graphical reporting class with which I can easily display two-dimensional data. I hear some of you right now: "Why not use Crystal Reports since it's already a part of Visual Studio .NET, and you don't have to create your own class?" Good question. In fact, using Crystal Reports is how I started out.
The version of Crystal Reports I used had a lot of bugs. By the time you read this they should be fixed (I hope). In addition, I didn't have as much control as I wanted. I was constantly asking, "How can I make this look and act exactly as I want it to?" My challenge was kind of like using the databound controls they are easy to use and flexible, but it seems like you have to work really hard to do something that's outside the box.
Another thing about Crystal Reports is that you must pay a licensing fee to distribute it. Depending on your situation, the licensing fee might price you out of the market.
With my graphing class, I was able to provide exactly what the human resource types wanted understandable graphs that clearly depict the relevant information. The graphical reporting class relies on GDI+ (the latest rendition of Microsoft's Graphics Device Interface) to render the data into an image. Using GDI+ to create dynamic images is presented in the next section.