When we last left the Technical Resource Kit document for the Library Project, it listed five "built-in" reports:
Report #1: Items Checked Out Report
Report #2: Items Overdue Report
Report #3: Items Missing Report
Report #4: Fines Owed by Patrons Report
Report #5: Library Database Statistics Report
We'll add these five reports to the project in this chapter. Before we write any code, we need to figure out how we're going to get the data. Since the data will come from the Library database, we just need to craft the SQL statement for each report that will link to the designed report.
The fifth report, "statistics," will report things such as the number of items, the number of patrons, and other similar statistical values from the Library database. Since this data can't really come from a single SQL statement, we'll extract the data from the database and build a custom data source that feeds into the report.
The first report, "items checked out," lists the patron name and item title for every item currently checked out by the patron. It involves the
Patron table (to get the patron name), the
PatronCopy table (the checkout event), the
ItemCopy table (the actual item checked out), and the
NamedItem table (where the item title appears). We'll also include the
CodeMediaType table, which tells us whether the item is a book, a CD, or some other media type.
Microsoft SQL Server Management Studio Express includes a visual Query Designer that we can use to design the ...