Sorting Data

book list add book to my bookshelf create a bookmark purchase this book online

mastering crystal reports 9
Chapter 2 - Modifying a Report
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

We’ve shown that groups can be sorted, which will arrange one group of data before another group. What about the data, or detail records, within each group? For instance, in our report we’ve created groups based on the Country field, but in the group for each country, we haven’t specified whether resorts or resort codes that start with the letter A should come before those that start with the letter Z. To do this, we need to use explicit sort options that are not related to grouping; instead, the sort order is related to the records as a whole.

Record-sorting options are available using the menu sequence Report > Record Sort Expert or its equivalent toolbar icon. The Record Sort Expert displays the hierarchy of the groups implemented in the report and lets you select a field to use to sort the records. Figure 2.17 shows that there are three groups in the report and their sort order (S for specified order and A for ascending). The records within each country within a region will be sorted in ascending order.

click to expand
Figure 2.17. Sorting records

As mentioned with sorting groups, the data type of a field contributes to the sorting rules. Date and time values sort chronologically; text fields sort nonalphabetic characters before alphabetic characters, and uppercase letters sort before lowercase letters.

You can also specify multiple record-sorting fields. For instance, in data for North America, you might sort by state first and then by city. Each field that you sort on can be sorted in ascending or descending order. The upward- and downward- pointing triangles shown at the top right of Figure 2.17 can be used to prioritize the sorts in a way that makes sense for the data. There is no limit to how many fields can be sorted.

Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement
 
Conello © 2000-2003     Feedback


Mastering Crystal Reports 9
Mastering Crystal Reports 9
ISBN: 0782141730
EAN: 2147483647
Year: 2005
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net