Mastering Business Analysis with Crystal Reports 9 (Wordware Applications Library)
|
When a report grabs records from a database, the records typically display in an order determined by data type. The sort order that most databases use for records is summarized in Table 8-1.
Field Type | Sort Order |
---|---|
Single-character string fields | Blanks Punctuation Numbers Uppercase letters Lowercase letters |
Multiple-character string fields | Two letters Three letters Four letters Five letters ... etc. |
Currency fields | Numeric order |
Number fields | Numeric order |
Date fields | Chronological order |
DateTime fields | Chronological order Same-date values by time |
Time fields | Chronological order |
Boolean comparison fields | False values (0) True values (1) |
NULL values | NULL values Non-NULL values |
Unfortunately, this order is rarely useful. For example, check out Figure 8-1. In this figure, there's a report that pulls records from the Supplier table. Notice that there's no meaningful order as to how the records display (for example, the records don't display in alphabetical order).
Luckily, Crystal Reports allows you to sort text, numeric, and date fields in the two following orders:
-
Ascending, which means records sort upward (such as from lowest to highest, earliest to latest, first to last, or A to Z)
-
Descending, which means records sort downward (such as from highest to lowest, latest to earliest, last to first, or Z to A)
In Crystal Reports, you also have the choice of sorting on only one field (known as single field sorting) or more than one field (known as multiple field sorting). In Crystal Reports, all sorting is handled through the Record Sort Order dialog box.
|