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

Related Topics

How to summarize grouped data, Page 289

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 sort based on summarized group values

Click the TOP N button on the supplementary toolbar. The Top N Sort Group Expert appears with a tab for each of the groups in the report.

Click the tab for the group you want to sort.

! Select the Sort All option from the left hand drop-down box.

"In the top drop-down box on the right, select the summary you want to sort by (if you have more than one summary in the group section. For example, you might have both a sum and an average summary in a section).

# Click the option button for the sort direction you want.

$ If you want to select a second sort group, repeat Steps 2-5.

When you run the report, the program will sort your data based on the group order(s) specified.

How to extend prices and then subtotal the extensions

In an orders report or invoice, you may need to extend the prices for individual line items and then subtotal the extensions. You do this using a simple formula to extend the prices, and then you subtotal the formula field.

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

Sorting, Grouping, and Totalling

293

{customer.CUSTOMER ID} {orders detail.PRODUCT ID} {orders detail.QUANTITY} {orders detail.UNIT PRICE}

To create the formula for extending the prices, click the Formula Tab in the Insert Fields dialog box to activate it.

3 Click the New button.

4 Type the name you want to identify the formula.

#When you click OK, the Formula Editor appears. Enter the following formula into the Formula text box:

{orders detail.QUANTITY} * {orders detail.UNIT PRICE}

See Formulas 101, Page 321, for more information on formulas.

$Click the Accept button when finished. The Formula Editor disappears and the program returns you to the Insert Fields dialog box with the name of your formula highlighted in the list box.

294

Seagate Crystal Reports User’s Guide

The formula you just created.

7 Click the Insert button to place the formula in your report.

&Place the formula field to the right of the Unit Price field in the Details section of your report.

' Click Close to close the Insert Fields dialog box.

Next you will subtotal the extensions.

NOTE: In the screenshot below, menus have been shortened by removing some of the commands that are unrelated to the current discussion.

10 Right-click the formula field.

11 Choose the Insert Subtotal command from the shortcut menu that appears.

The Insert Subtotal dialog box appears, already set to subtotal @Extension (the extended price field). For more information on summary functions, search for Summary functions in Seagate Crystal Reports online Help.

You are interested in weekly sales so you want to create a subtotal whenever the values in the Order Date field change from one week to the next.

Sorting, Grouping, and Totalling

295

Choose {orders.ORDER DATE} as the sort and group by field, and choose for each week as the date change that is going to trigger the grouping.

NOTE: In order to do this, the Orders table must be linked to the Orders Detail table before you preview the report. Search for Visual Linking Topics Index in Seagate Crystal Reports online Help.

NOTE: The Section will be printed drop-down box will not be activated until you choose the Order Date field.

Your dialog box should look like this:

Your data will be sorted by date.

And grouped whenever the date changes from one week to the next.

When you click OK, the program inserts the subtotal in the report. Your final report should look similar to the following:

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

296

Seagate Crystal Reports User’s Guide

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