Grouping and Sorting Information

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

mastering crystal reports 9
Chapter 1 - Building Your First Report
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

The Grouping dialog follows the same familiar approach of selecting items from the left and copying them to the right. On the Available Fields list, however, there are now two categories, as shown in Figure 1.16.

click to expand
Figure 1.16. Grouping the information

Tip 

Navigate to the Grouping and Sorting dialog using the Next button or by clicking directly on the tab.

Choosing a Field to Group By

The first category of fields is Report Fields. You can think of these as the fields you’ve already asked to be included in your report. The second grouping shows all the fields in the data source being used for the report, including the ones from your report, meaning there is inherent duplication.

If you choose a field to group by that is not represented by the Report Fields category, the new field will be automatically added to the list of fields that display in your report.

Business Question: How many resorts does VistaNations have in each country and what are their names?

Our business question requires that we determine how many resorts are in each country, so we’ll create a grouping based on the Country field. We select the Resorts.Country field from the list on the left and use the buttons in the middle to copy the field to the Group By list on the right, as shown in Figure 1.17.

click to expand
Figure 1.17. Group By Country

Sorting a Group

By default, a group is sorted in ascending order. The sorting drop-down box is located at the lower right of the Grouping dialog (see Figure 1.17). You can change the sort order to descending if you wish.

The -A to the right of the field name in the Group By list tells you that the Resorts.Country field will be sorted in ascending order; -D would appear for descending order.

Note 

After the wizard completes and you are in the Crystal Reports design environment, you can still add groups using the toolbar. Notice the icon in the top-right corner of the Grouping dialog, shown in Figure 1.17. This icon will appear on the Crystal Reports toolbar later. Notice also that this part of the screen identifies grouping as an optional step. This is the first time you’ve seen this feature in the Report Creation Wizard. The icon is a signal to you that you can expect reasonable results at any point when you click the Finish button.

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