Creating Grand Totals for Your Reports


Adding grand totals to your reports is nearly identical to adding subtotals. In many ways, it may be easier. A grand total takes a single field and creates a total value for those fields. That total value is then displayed on the last page of your report.

To insert a grand total into your report, try the following. Use the report you've been working on within this chapter.

  1. Select the Design tab.

  2. Select the Order Amount field (from the Details section).

  3. Select Insert, Insert Summary from the menu bar.

    The Insert Summary dialog box displays.

  4. In the Choose the field to summarize drop-down field, select the Order Amount field (from the Orders table).

  5. In the Calculate this summary drop-down field, select Sum.

  6. To create grand totals, select Grand Total (Report Footer) from the Insert Summary dialog box.

Once you've done these steps, press the OK button and preview your report. Press the Last Page arrow button to go to the last page of your report. Figure 9-3 displays how your screen should look.

click to expand
Figure 9-3: Adding a grand total

Tip

If for some reason you're not pleased with the result of your calculation, Crystal Reports makes it easy to change your work. Right-click on the value to display an Options dialog box. Select Edit Summary.

You're returned to the Insert Summary dialog box, where you can make changes as needed. Of course, you can always continue selecting the Insert Summary dialog box from the menu bar.

Defining Other Calculations

As your delve further into report development, you'll find yourself creating more and more calculations within your reports.

Calculations provide users with the ability to take data from a database and create mathematical representations of their data that is meaningful. For example, by creating a calculation that adds sales and cost information together, you might create a calculation that displays gross profit information — information that wasn't directly available from your database but available through the use of calculations.

As you've seen in the Insert Summary dialog box, Crystal Reports contains a number of "canned" calculations available at your fingertips. You've played around with the Sum calculation. Table 9-1 summarizes the rest of the predefined calculations available.

Table 9-1: The different calculations available within Crystal Reports

Calculation

Definition

Sum

Allows you to add the values that appear within a field.

Average

Allows you to average the values that appear within a field.

Sample variance

Allows you to print the average of the values within a field.

Sample standard deviation

Allows you to print the standard deviation of the values in the field (or group).

Maximum

Allows you to print the largest value within a field.

Minimum

Allows you to print the smallest value within a field.

Count

Allows you to print the number of entries within a field.

Distinct count

Allows you to print the number of unique records within a field.

Correlation with

Allows you to compare the values within two fields.

Covariance with

Allows you to measure the tendency two fields vary together (the linear relationship), according to a specific mathematical relationship.

Median

Allows you to print the middle value in a sequence of numeric values.

Mode

Allows you to print the most frequently occurring values within a field.

Nth largest, N is

Allows you to print the Nth largest value within a field. N is any integer from 1 to 100 (inclusive).

Nth smallest, N is

Allows you to print the Nth smallest value within a field. N is any integer from 1 to 100 (inclusive).

Nth most frequent, Nis

Allows you to print the Nth-most-frequent value within a field. N is any integer from 1 to 100 (inclusive).

Pth percentile, P is

Allows you to print the value for a specified percentile (P) in a Number or Currency field. P is any integer from 0 to 100 (inclusive).

Population variance

Allows you to print the population variance of the data.

Population standard deviation

Allows you to print the population standard deviation of the data.

Weighted average with

Allows you to print the average of one field. You then use the values in another field to "weigh" the contribution of each value in the first field to the average.

Note

Should you not see a specific calculation that you need in this table, don't sweat it. In the next chapter, we learn about creating our own unique calculations using the Formula Expert.




Mastering Business Analysis with Crystal Reports 9
Mastering Business Analysis with Crystal Reports 9 (Wordware Applications Library)
ISBN: 1556222939
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Chris Tull

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