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

The MutuallyExclusiveGroup property goes along with the previous two properties, and determines if a Grouped Parameter Field will be mutually exclusive. A Parameter is mutually exclusive if when selecting one of it's values, the other Parameters in the Group are de-selected.

The ValueType property specifies whether the Parameter Field uses Discrete values or Ranges.

The Retrieve method will fetch the Parameter Field Info for the current Parameter specified in the ParamField object, and will set the Info properties accordingly.

The Clear method will set the Info properties to default values.

The CopyFrom method will copy the Info property values from another Info object. ParamFields Info Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

ParamFields Info AllowEditing property

Declaration

property AllowEditing: TCrBoolean;

Description

This property determines if the Parameter Field can be edited in the Prompt Dialog. If it is set to cFalse, the user will have to choose one of the DefaultValues from the drop-down list in the Parameter Field Prompt Dialog.

Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

VCL Reference

447

ParamFields Info AllowMultipleValues property

Declaration

property AllowMultipleValues: TCrBoolean;

Description

This property determines if the Parameter Field will accept more than one value. If it is set to cTrue, an extra ListBox will appear in the Prompt Dialog to which the user can add multiple values to be sent into the Parameter. When multiple values are passed into a Parameter Field, the Parameter is treated as an array of values, as in this example:

["Smith", "Jones", "Brown"]

Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

ParamFields Info AllowNull property

Declaration

property AllowNull: TCrBoolean;

Description

This property specifies whether the Parameter Field will accept a null value; that is, whether it can be left blank in the Prompt Dialog. This property only applies to Stored Procedure Parameters, which from Crystal Reports 7 and up, are now read through the ParamFields object, instead of SQL.Params (as with Crystal Reports 6 and lower).

VCL Reference

448

Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

ParamFields Info GroupNum property

Declaration

property GroupNum: smallint;

Description

The GroupNum property specifies the Group that the Parameter Field belongs to. This only applies if PartOfGroup is set to cTrue.

Notes on Grouping: Grouping of Parameters only applies to Boolean Parameter Fields. With Grouping, multiple Boolean Parameter Fields can be treated as a Group, whereby they will all appear on the same tab of the Parameter Field prompt dialog. The PartOfGroup property turns the grouping feature on or off for a Parameter Field. The GroupNum property determines which Group a grouped Parameter belongs to.

Grouped Parameters will be presented in a drop-down list. If MutuallyExclusiveGroup is set to cFalse, more than one item can be selected from the drop-down list and added to a listbox. All Parameters added to the listbox will have a True value, all those not in the listbox will have a False value. If MutuallyExclusiveGroup is set to cTrue, then only the Parameter selected in the drop-down list will have a True value, and all other Boolean Parameters in that Group will have a False value.

Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

VCL Reference

449

ParamFields Info MutuallyExclusiveGroup property

Declaration

property MutuallyExclusiveGroup: TCrBoolean;

Description

This property determines if a Grouped Parameter Field will be mutually exclusive. A Parameter is mutually exclusive if only one member of the Group can be selected, and when selecting it, the other Parameters in the Group are de-selected.

Notes on Grouping: Grouping of Parameters only applies to Boolean Parameter Fields. With Grouping, multiple Boolean Parameter Fields can be treated as a Group, whereby they will all appear on the same tab of the Parameter Field prompt dialog. The PartOfGroup property turns the grouping feature on or off for a Parameter Field. The GroupNum property determines which Group a grouped Parameter belongs to.

Grouped Parameters will be presented in a drop-down list. If MutuallyExclusiveGroup is set to cFalse, more than one item can be selected from the drop-down list and added to a listbox. All Parameters added to the listbox will have a True value, all those not in the listbox will have a False value. If MutuallyExclusiveGroup is set to cTrue, then only the Parameter selected in the drop-down list will have a True value, and all other Boolean Parameters in that Group will have a False value.

Example

This example retrieves the ParamFields values from the Report, and sets the first ParamField to allow editing, and to disallow multiple values:

Crpe1.ReportName := 'C:\Company.rpt';

Crpe1.ParamFields.Retrieve;

Crpe1.ParamFields[0].Info.AllowEditing := cTrue;

Crpe1.ParamFields[0].Info.AllowMultipleValues := cFalse;

Crpe1.ParamFields[0].ShowDialog := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

ParamFields Info PartOfGroup property

Declaration

property PartOfGroup: TCrBoolean;

VCL Reference

450

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