Chapter 20. Reporting
Only when the facts stored in a database system are combined in meaningful ways do they become information; before then, they are only trivia. In this chapter, we'll look at various issues involved in providing those meaningful combinations of factsthat informationto your users.
When I use the term "reporting" in this chapter, I don't mean only the production of printed reports. I'm using the word in a more general sense, to mean the provision of information based on data stored in the database. This information might be provided in the form of a printed report, but it might also be provided in a form or as a recordset shown in datasheet view.
In the days when computers cost much more than employees and computing time was an extremely scarce resource, database systems produced a few reports at regular intervals. If you wanted the system to do anything special, you could pretty much whistle for it. The backlog in the average MIS department was several years, so if you needed a report "just like this one, only sorted by Customer and subtotaled by State," you'd give it to your secretary, who would type it up for you.
These days, computers are cheap and plentiful and secretaries are extremely scarce resources. A user must now be able to tell the computer system, "I'd like a report just like this, but..." and that means your job as a database designer has gotten a little harder. But hey, it beats taking shorthand dictation. (You can trust me on this one.)
There are two general approaches to providing reporting functionality in a database system: attempt to predict all the possible reports in advance; or allow users to create them as needed. Most systems require a combination of both approaches.
The reports you can predict when designing the system can be created during implementation. I call these types of reports standard reports. You can also provide some mechanisms for users to create their own reports after the system has been implemented. I call these types of reports ad hoc reports. We'll look at both types of reports in this chapter, but first we'll examine mechanisms for the sorting, searching, and filtering of data that reports require.