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

TCrBooleanToStr method

Declaration

function TCrBooleanToStr(const crbValue: TCrBoolean): string;

Description

TCrBooleanToStr is used internally in the Crystal component, but has been exposed for general purpose use. It takes a TCrBoolean type value and returns the type formatted as numeric string representing the ordinal value.

var

sTmp : string; crBool : TCrBoolean;

begin

crBool := cFalse;

sTmp := Crpe1.TCrBooleanToStr(crBool); {sTmp is now '-1'}

end;

This numeric string can easily be converted back into a TCrBoolean value by either using the StrToTCrBoolean function:

crBool := Crpe1.StrToTCrBoolean(sTmp); {crBool is now cFalse}

...or a line of code similar to this:

crBool := TCrBoolean(StrToInt(sTmp));

TimeToStr method

Declaration

function TimeToStr(const tValue: TDateTime): string;

Description

TimeToStr is used internally in the Crystal component, but has been exposed for general purpose use. It takes a DateTime value and returns the equivalent Time value formatted as a string.

str1 := Crpe1.TimeToStr(Now);

{str1 now looks something like this: '12:02:31'}

VCL Reference

164

TruncStr method

Declaration

function TruncStr(sValue: string): string;

Description

TruncStr is used internally in the Crystal component, but has been exposed for general purpose use. It takes a Floating point value formatted as a string, and removes the floating point values.

str1 := Crpe1.TruncStr('12.34'); {str1 is now '12'}

VerifyDatabase method

Declaration

function VerifyDatabase: boolean;

Description

This method requires Seagate Crystal Reports 7.0 or higher. The VerifyDatabase method causes the Crystal Reports Print Engine to re-read the structure of the database tables used in a Report, and update the Report accordingly. Since the Report stores the structure information for every table it uses, this should be updated if the structure (field names, sizes and types) has changed.

This method checks the FieldMapping setting, and if any of the field names have changed, it will cause the Print Engine to do one of three things, depending on the setting of the FieldMapping property:

1.FieldMapping set to fmAuto

Any fields in the Report that no longer have the same field names will be removed from the Report.

2.FieldMapping set to fmPrompt

If any field names have changed, the Print Engine will show a Mapping Dialog that can be used to map the fields to fields from the current database table.

3.FieldMapping set to fmEvent

If any field names have changed, an OnFieldMapping event will be triggered. This event is on the events page of the Object Inspector, and allows the developer to either design their own Mapping Dialog, or bypass the dialog by doing the mapping in code.

VCL Reference

165

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