In this movie we're going to introduce you to Basic Summary Functions. Using Report1, that's our report that points to the Employee Table, our Test Database, go ahead and click on the Design tab. Now, when we created this report using the Report Wizard we specified Summary Functions that we wanted to see. You can also insert them at any time once you're outside the Report Wizard. The Summary Fields themselves can actually only be placed in the Report sections, or the Group sections of a Crystal Report. You may not place Summary Functions into the Detail section. If I take my mouse over the Summary Field it gives us a quick tag of what the Summary Field is. You can also right-click on the field to see what kind of summary it is and what fields it's summarizing. In this case we're summarizing the first name and the chosen summary is Distinct Count. The summaries that are available to you are strictly based on the type of field that you've chosen to summarize. For example, First Name is essentially a text field Ð no numbers Ð you can't add first names and Alex plus John does not equal 26. What you can do with first names, however, according to Crystal, are the following: you can choose a Maximum, a Min, a Count, a Distinct Count, Mode, and a few more You can also change a summary at any given time. Let's say we didn't want to summarize what the first name was, but instead wanted to summarize EmployeeID. Go ahead, click on the Preview tab and then scroll halfway down. As we can see, the Distinct Count of EmployeeID is 25. Go ahead and Preview, right-click on that same field and Edit the summary again. This time choose Employee First Name. There are 26 employee first names in our table. More importantly, there are 26 Distinct Counts of employee first names, i.e., there are 26 distinct non-same names. Let's go ahead and scroll over and this time we're going to insert another summary field. Go ahead and click on the Insert Menu at the top of the screen. Go ahead and choose Summary. This is the Insert Summary Window, and from here we can choose the Field, which in this case is going to be the Employee Last Name, and we don't want a Maximum, we want a Distinct Count. Go ahead and choose Distinct Count and we'll leave the Grand Total Footer as the Summary Location. From here you can also insert a group if you've forgotten one or feel you need one. In this case we don't, so go ahead and press OK. This field appears here and it's a Distinct Count of Employee Last Name. Now, according to the Distinct Count of the first names we have 26. In the last names we have 25. Go to the Record Sort Expert and click. Make sure that your Sort Field is on Employee Last Name. If not, go ahead and make it so and press OK. The difference between Count and Distinct Count in the summary example is that Williams appears twice. Now, albeit there's a Hank William and then there's a Tennessee Williams, so technically there are 26 in the total table, but only 25 distinct counts. It's just a small illustration of the difference between these two. The Summary Fields can actually get a little bit more complicated than that. Go ahead and right-click on the Summary Field underneath Last Name choose Edit Summary. This time instead of a Count or a Distinct Count go ahead and choose Maximum and press OK. The question to ask yourself is why Zavorotny was the Maximum? The Maximum kind of goes in alphabetical order, meaning that Z, being the last letter of the alphabet, is the maximum if you will of the alphabet, therefore Zavorotny appears as the Maximum. Now, let's say we reverse that and we edit the summary and we choose Minimum and then press OK. Again, alphabetically speaking A is minimum. Now, in case of a tie, if there were two Z's for example, Zavorotny and Zeus, it would take the next letter to determine which is which. It's a little bit tricky but once you get the hang of it it's actually pretty easy. To recap, Summary Functions are determined by the type of field you tend to be summarizing. Special care must be given to text fields as they don't behave as numbers do. In the follow lessons we'll get deeper into Summary Functions, but this should serve as a basic lesson in Crystal Summaries.
| Course: | Crystal Reports XI: Beginner |
| Author: | Kurt Dunlap |
| SKU: | 33966 |
| ISBN: | 1-935320-29-7 |
| Release Date: | 2009-02-10 |
| Duration: | 6.5 hrs / 95 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |