Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

NOTE: To see an example of the above report, open the

SGT05.RPT file in the \CRW directory.

Related Topics

Reporting 101, Page 95

How to do a single field sort, Page 281

How to do a multiple field sort, Page 283

How to summarize grouped data

Often you will want to summarize the data in each group and print the summaries in your report. You can use summaries to:

count the number of values in a group,

calculate the sum, average, standard deviation, or variance of values in a group, or

identify the minimum or maximum value in a group.

For more information on summarizing your data, search for

Summary functions in Seagate Crystal Reports online Help.

For example, you may want to count the number of customers in each country. To do this, the data must be broken into country groups, and then the records in each group must be counted. Instead of grouping the data manually and then summarizing it, you can let the program group and summarize in a single step.

To get started, create a report using the sample data, CRAZE.MDB, and place the following fields from left to right in the Details section:

{customer.CUSTOMER NAME} {customer.REGION} {customer.POSTAL CODE} {customer.COUNTRY}

Click the Customer Name field (the field you want to summarize) and click the SUMMARY button on the standard toolbar. The Insert Summary dialog box appears.

Sorting, Grouping, and Totalling

289

NOTE: This example report has been designed to illustrate concepts only, not the actual look of your finished report.

3 Select the desired summary operation from this list.

4 Highlight the field you want the data to be grouped by.

5 Specify the sort direction.

6 Click OK when finished.

The data is

broken into

Country

groups.

This will count the records in each group.

290

Seagate Crystal Reports User’s Guide

NOTE: To see an example of the above report, open the

SGT06.RPT file in the \CRW directory.

Related Topics

Reporting 101, Page 95

How to subtotal grouped data, Page 291

How to create multiple levels of subtotals, Page 297

How to extend prices and then subtotal the extensions, Page 293

How to calculate a percentage of the grand total, Page 310

How to create group headers, Page 313

How to subtotal grouped data

A subtotal is a special kind of summary. It totals or sums numeric values in a group. Like any summary, the program groups and subtotals in a single step. For more information on summary functions, search for Summary functions in Seagate Crystal Reports online Help.

In this example you will group the data by Country and subtotal

Last Year’s Sales by Country.

To get started, create a report using the sample data, CRAZE.MDB, and place the following fields from left to right in the Details section:

{customer.CUSTOMER NAME} {customer.REGION} {customer.POSTAL CODE} {customer.COUNTRY} {customer.LAST YEAR’S SALES}

Right-click the Last Year’s Sales field and choose the INSERT SUBTOTAL command from the shortcut menu that appears. The Insert Subtotal dialog box appears with the chosen field listed at the top of the dialog box.

NOTE: This example report has been designed to illustrate concepts only, not the actual look of your finished report.

Sorting, Grouping, and Totalling

291

Choose the field you want the data grouped by, specify a sort direction and then click OK when finished.

The field you selected to be subtotaled.

Data is broken into Country groups.

The values in each group

are now subtotaled.

NOTE: To see an example of the above report, open the SGT07.RPT file in the \CRW directory.

292

Seagate Crystal Reports User’s Guide

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]