Ken Mayer
The dBASE Report Designer can be a daunting tool, but with this book
you can learn to use it to your best advantage, and create professional
looking reports. Included are the following topics:
* Custom Reports and Classes
* Understanding the Report Engine and Designer's Event Model
* Learning About the Report Object Event Sequences
* Grouped Reports
* Multi-Table Reports
* Calculated Fields and Lookup Fields
* Working with Labels
* Using a ReportViewer
* Cross-Tab Reports
And much more is included.
The dBASE Reports Book teaches not
only how to use the Report Designer to achieve your goals, but also to
work with the dBASE Programming Language (dBL) to work with and enhance
the functionality of your reports. This is a companion to
The dBASE Book, written by the author in 2005.
Ken Mayer has used dBASE both as a hobbyist and as a professional coder
for 22 years, starting with dBASE III+ and working up to dBASE PLUS.
Ken worked for Borland, Intl. for two years as a Senior Quality
Assurance Engineer on the Intrabuilder and dBASE products (Intrabuilder
1.0, Visual dBASE 7.0 and 7.01), and also worked for five years for
dBASE Inc. as a Senior Quality Assurance Engineer, also working on
dBASE (Visual dBASE 7.5, dB2K and dBASE PLUS, as well as dQuery). Ken
was a contributing editor to dBASE Advisor magazine for the one and a
half years or so it was in publication. He served on Borland?'s TeamB
(volunteer technical support) when Borland owned dBASE, and has helped
many in the dBASE developer community. At this time he is a member of
the dBVIPS for dataBased Intelligence, Inc., doing the same things he
did with TeamB. He authored a good portion of the Knowledgebase articles that ship with dBASE PLUS,
and authored the original dBASE PLUS tutorial. Ken is the author of
The
dBASE Book, the book that was released in late 2005 aimed at helping a
developer learn to build applications in dBASE.
Chapter 19
Cross-Tab Reports
What exactly is a cross-tab or cross tabular report? This is a
concept that causes many developers to blink, stutter in confusion, and
sometimes walk away from a conversation. I used to think it was similar
to turning a table on its side so that the fields acted like rows, and
the rows acted like fields, and in a way I was sort of correct, but not
really.
A cross-tab report is one that summarizes data in a (hopefully) simple
way. An example I found on the web uses data that we have not yet
looked at in this book that might help show what is meant by this.
Suppose we have a table that lists household expenses (or for a
business, business expenses, but we’ll stick with the data I have).
This table might have fields for a date, a category, an amount spent,
and perhaps a notes field so that you could explain in more detail what
the purchase was. To keep things simple, we’ll keep the categories as:
Auto Repair/Maintenance
Auto Fuel
Groceries
Household
House Payments
Miscellaneous
A useful cross tabular report would be to show how much was spent each
month for each of these categories. The report might include a
monthly average for each category, as well as an annual total.
In order to do this, you would need to create a new table, that was
designed to have fields for the category, the month (12 of them), a
field for the average, and a field for the total. Then you would need
to create a program that filled in the cross tab table, and create a
report from it.
This chapter is going to walk through the steps of the process, one at a time.