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

Description

The PartOfGroup property determines if the Parameter Field is grouped with other Parameter Fields. If it is, it will appear on the same tab of the Prompt Dialog as the other Parameters it is grouped with.

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 ValueType property

Declaration

property ValueType: TCrParamInfoValueType;

Type

TCrParamInfoValueType = (vtRanges, vtDiscrete);

VCL Reference

451

Description

The ValueType property specifies whether the Parameter Field uses Discrete values or Ranges. The difference between Discrete and Range values are illustrated below:

Discrete Values

String : "CA"

Number : 12

Currency : 22.33

Date : 1998,01,01

Boolean : False

Range Values

String

: "CA" to "WA"

Number

: 12 to 24

Currency

: 22.33 to 33.33

Date

: Date(1998,01,01) to Date(1998,01,31)

Boolean: Range Values not available for Boolean

NOTE: The AllowMultipleValues property determines whether there can be more than one value passed in a ParamField. In the case of Discrete Values, this would mean an array of values, i.e.: ["CA", "AK", "WA"]. In the case of Range values, this would mean an array of ranges, i.e.: ["CA" to "IL", "PA" to "WA"].

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 Clear method

Declaration

procedure Clear;

VCL Reference

452

Description

This method can be used to clear the internal memory of the Info object. It is called automatically if the Clear method is called for the main component, or if a new Report name is assigned to the ReportName property, but may be called in code as desired.

The Clear method is only applied to the Info object of the current ParamField, and the current Report/ Subreport specified in the Subreports object. Therefore, to clear all the ParamField Info of all the ParamFields in all the Subreports, will require a looping procedure that goes through each Subreport and applies the Clear method to each ParamField.

Example

This code clears the ParamField Info for the first ParamField in the main Report (assuming the default state of Subreports[0]):

Crpe1.ParamFields[0].Info.Clear;

NOTE: Using ParamFields.Clear instead, will clear all the Info for all the ParamFields at once.

ParamFields Info CopyFrom method

Declaration

function CopyFrom(Source: TCrpeParamFieldInfo): boolean;

Description

The CopyFrom method copies the Info property values from another TCrpeParamFieldInfo object. It is similar to Delphi's Assign method. It is useful for transferring or temporary storage of values.

Example

The following example copies all the Info property values to a temporary TCrpeParamFieldInfo object:

var

tempInfo : TCrpeParamFieldInfo; begin

tempInfo := TCrpeParamFieldInfo.Create; tempInfo.CopyFrom(Crpe1.Paramfields.Info); {...later, when finished with the temp object...} tempInfo.Free;

end;

VCL Reference

453

ParamFields Info Create method

Declaration

constructor Create;

Description

The Create method is used internally in the Crystal component to create the Info object, and does not need to be called in code, unless you are using the CopyFrom method to store Info data to a temporary object:

var

tempInfo : TCrpeParamFieldInfo; begin

tempInfo := TCrpeParamFieldInfo.Create; tempInfo.CopyFrom(Crpe1.ParamFields.Info);

end;

ParamFields Info Retrieve method

Declaration

function Retrieve: boolean;

Description

The Retrieve method obtains the Parameter Field Info information (for the current ParamFields item) from the Report and stores it in the Info object. If Parameter Field Info was not found, the call returns False.

NOTE: This method is automatically called internally in the ParamFields.Retrieve method, and so will not normally be required in code.

Example

In this code example, the first ParamField item is manually created using the Add method. The Add method requires the Parameter Name (assumed as "Parameter1" in this example) and the Report Name (blank for the main Report). Then the ParamField Info property values are retrieved:

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

Crpe1.ParamFields.Add('Parameter1', '');

Crpe1.ParamFields[0].Info.Retrieve;

VCL Reference

454

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