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

GroupCondition

Declaration

property GroupCondition: TCrpeGroupCondition;

Type

TCrpeGroupCondition = class(TPersistent)

Description

The GroupCondition object contains the properties that refer to the Grouping fields in a Report. Unlike SortFields and GroupSortFields, a GroupCondition cannot be added or deleted from a Report at runtime. However, it is possible to set all the Groups to the same field, thus in effect nullifying all but one of them. The main properties in GroupCondition are:

The Number property represents the actual Group number in the Report, and unlike most of the other numbering in the component, Groups start with number 1. This is easier to remember, since in the Crystal Reports Designer there is no such thing as Group 0.

The Field property specifies the actual field value that the Group is based on, which could be a database field, or a formula field. Remember to enclose database fields in braces {}, and to prefix formula names with the @ symbol.

The Condition property specifies the condition that the Group changes on.

The Direction property specifies in which order the Groups will be sorted.

The Retrieve method can be used to retrieve and fill the GroupCondition object with values from the Report.

The Count method will return how many items are in the GroupCondition object (i.e. how many groups are in the Report), and can be used for looping constructs.

The Number property, the default array property Item, and the ItemIndex property can be used to navigate through the items in the GroupCondition object.

NOTE: If you have Crystal Reports 6.0, GroupOptions can be used instead of GroupCondition. It has all the functionality of GroupCondition, plus TopN properties, and other features as well.

VCL Reference

39

GroupCondition Example

This sample retrieves the GroupCondition values from the Report, and sets the first Group to the {company.STATE} field, ascending:

Crpe1.ReportName := 'C:\Company.rpt'; with Crpe1.GroupCondition do

begin

Retrieve; Number := 1;

Field := '{company.STATE}';

Condition := AnyChange; Direction := gcAscending;

end; Crpe1.Execute;

GroupCondition Properties

GroupCondition Condition property, Page 354

GroupCondition Direction property, Page 355

GroupCondition Field property, Page 356

GroupCondition GroupType property, Page 357

GroupCondition Item property, Page 358

GroupCondition ItemIndex property, Page 358

GroupCondition Number property, Page 359

GroupCondition Methods

GroupCondition Add method, Page 360

GroupCondition Clear method, Page 361

GroupCondition CopyFrom method, Page 361

GroupCondition Count method, Page 362

GroupCondition Create method, Page 362

GroupCondition Delete method, Page 363

GroupCondition Destroy method, Page 363

GroupCondition Retrieve method, Page 364

GroupCondition Send method, Page 365

VCL Reference

40

Соседние файлы в папке Crystal