Programming
Custom Reports in .NET?
by admin on Sep.01, 2008, under Programming
When I wrote my first incarnation of the student database back in January 2005, we needed some reports (receipts, student lists etc). I used part of the ComponentOne Studio for .NET that I was lucky enough to acquire as part of the free VB.NET Resource Kit. It worked well, but the report requirements for that application were fairly small.
For our main office application, the requirements were much higher. We’re a franchise of a national organisation and so twice a month need to provide the major franchise with reports on the number of clients served and the amount of money received. Given that we have a large number of locations to report on, the report generally spans a few pages.
I had learnt about the Crystal Reports for Visual Studio .NET and how to use them after developing and deploying the student database, and as such wanted to use that package rather than ComponentOne, as the report I needed to do is something like Crystal’s Cross-Tab report. The ComponentOne reporting component was rather primitive in this regard.
I did try the Crystal Cross-Tab, and although it almost worked for a small number of locations, the large number we have meant that it would fail to display correctly.
In the end, after some research, I found that I could extend the System.Drawing.Printing.PrintDocument class, override the OnPrintPage event and manually generate the table structure and output the data required, in the format I wanted. It is a rather crude solution, but it works.
I have extended it in the past few months, because I wanted to be able to generate a PDF output with a particular filename, as the report viewer I was using wouldn’t allow me to do that without displaying a save dialog. After searching for .NET PDF components, I eventually found one which did everything I wanted called iTextSharp (http://itextsharp.sourceforge.net/). Again, the work I had to do behind the scenes to translate the calls to e.Graphics into outputs onto the PDF is crude, but it works well.
I bring this up after all this time, because I’m about to create my first new report using this format in the last few years for the rostering application. I just hope I can remember how to do it.
My blog 101
by admin on Aug.31, 2008, under General Banter, Programming
When trying to think of something, anything, to blog about in the past it has been a random hodge-podge of irregularly-updated posts about nothing and anything at the time.
Considering over the next 12 months I will be embarking on a rather large feat to develop 3 new applications, one of which is a web app, and to continue maintaining the 2 applications that are currently deployed, I think I’ll use this blog to document that journey.
The applications we currently have deployed are:
- a customer database, trust account management and reporting system: almost all of the day-to-day functions for our offices involve this software in some way, shape or form (.NET 1.1); and
- a student database: we run a course each year as a way of gaining our seasonal staff and their details and progress need to be tracked (.NET 2.0).
These applications have been constantly updated and expanded (specifically the first one) to improve the workflow for our staff and have both been developed over the past 3 years.
The new applications are:
- a rostering system: the current rostering process involves updating an excel spreadsheet which can be rather cumbersome and has a somewhat messy format (.NET 1.1);
- a backup system: backing up data to other PCs in the office, and to allow the backup to CD weekly (.NET 1.1/2.0); and
- a web-based customer engagement application: to allow the organisation to seek clients who prefer to interact either outside of hours, or are more tech-savvy and prefer to interact with an organisation online (.NET 2.0/3.5)
The first two aren’t terribly exciting. I’ve already started on the first one, the basic UI is completed and functional, the next bit will be to implement the report generation. The second is to replace the mostly manual process of backing up data to CD, and to once again regain a nightly backup process within the office.
The third is the most exciting. I’ve been out of the web game for some time now. I mean, our current website has still got a table-based layout, with some CSS for formatting only. I want the application to be functional and useable without sacrificing the security of the client’s sensitive data. I had intended to get this up and running by June/July of this year, but many delays brought me to concede it for another year. I am still optimistic that it can be completed by June/July next year and given that I’ll be starting development on it in the next month, I hope that I can churn out something good quickly and work on making it better.
So, please join me on my path of discovery as I fumble through creating these applications, and learning more about what the web has to offer a developer.