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

How to set a report title using parameter fields

Using a parameter field, Seagate Crystal Reports allows you to create a Report Title that can be changed each time the report is refreshed.

From the Insert Fields dialog box, click the Parameter Tab to activate it.

Click the New button. The Create Parameter Field dialog box appears.

!Type a name for the parameter field in the Parameter Name edit box. Type any prompting text you want to appear in the Prompting Text edit box. Select String in the Value Type dropdown box.

"Click OK when finished. You are returned to the Insert Fields dialog box. The parameter field you created appears in the list.

# Select the parameter field and click the Insert button.

$Place the parameter field in the Page Header section of your report if you want the title to appear on every page, or in the in Report Header section if want the title to appear on only the first page of the report.

Now when you refresh the data, the program will prompt you for a report title. You can change the title if you wish every time you run the report.

How to set sort order using parameter fields

To set the sort order using parameter fields, you need to create a formula that includes a parameter field and then sort on that formula. For example, assume that you have a customer list report based on the Customer table. For each customer, you show the Customer Name, City, Region, Country, and Phone Number. You want to be able to sort the report by Country, by Region, or by City, depending on your needs at the time.

Parameter Fields

403

Create a parameter field and name it SortField. See How to create a parameter field, Page 394.

In the Prompting Text edit box, type a prompt similar to this:

Type R to sort by Region or C to sort by City, otherwise data will be sorted by Country.

!Create a formula similar to this and call it Sort:

If {?SortField} = “C” Then {customer.CITY}

Else

If {?SortField} = “R” Then {customer.REGION}

Else

{customer.COUNTRY}

«This formula prompts for a value for the parameter field {?SortField}. If you enter “C”, the formula will sort by the City field. If you enter “R” it will sort by the Region field. If you enter anything else, or do not enter anything at all, the formula will sort by the Country field. See How to create multi-condition if-then-else formulas, Page 348

"Place the formula in the Report Header section of your report and toggle its Suppress option on in the Section Expert so it does not print. Search for Section Expert in Seagate Crystal Reports online Help.

#Click the SORT RECORDS button on the standard toolbar, choose your formula, @Sort, as your sort field. See How to do a single field sort, Page 281.

Now when you run the report, the program will prompt you for a sort field, the formula will return a value based on your selection, and the sort facility will use that value as your sort field.

404

Seagate Crystal Reports User’s Guide

17 Graphing

What you will find in this chapter...

Graphing Overview, Page 406

Where to place your graph, Page 407

Data you can graph on, Page 408

Before you create your graph, Page 408

HANDS-ON (Graphing), Page 408

Graphing

405

Graphing Overview

Seagate Crystal Reports enables you to include sophisticated, colorful charts and graphs in your reports. You can use graphs any time you want to improve the usability of your report. For example, you can use graphs to show 1995 fiscal results or the sales within the fiscal quarters.

Choosing a graph or chart type

Seagate Crystal Reports provides 12 graph/chart types. Different sets of data are particularly suited to a certain graph/chart type. The following is an overview of main graph/chart types and their most popular uses.

Side by Side bar graph

A Side by Side bar graph (also known as a column graph) displays a series of vertical bars. This type of graph is best suited for showing data for several groups over a period of time (for example, last year’s sales figures for CA, AZ, OR, and WA). Also available is a 3D Side graph.

406

Seagate Crystal Reports User’s Guide

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