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

Example

This example shows how to display the LastErrorNumber and LastErrorString. Normally these would be handled by the internal Error exception:

Crpe1.ReportName := 'MyReport.rpt'; Crpe1.Execute;

if Crpe1.LastErrorNumber > 0 then

ShowMessage('Error ' + IntToStr(Crpe1.LastErrorNumber) + ': ' + Crpe1.LastErrorString);

end;

LoadEngineOnUse

Declaration

property LoadEngineOnUse: boolean;

Description

The LoadEngineOnUse property determines if the Crystal Reports Print Engine DLL (CRPE32.DLL) is loaded into memory when the component is created.

If LoadEngineOnUse is set to True, the DLL will not be loaded until it is actually needed by the component (such as when retrieving values from a Report, or when running the Report). This is useful in applications where the user may not be using the Reports section of the application, and therefore does not need the DLL loaded.

If LoadEngineOnUse is set to False, the DLL is loaded into memory at the time that the component is created.

NOTE: The DLL can also be unloaded by calling the CloseEngine method, or by Destroying the component, although this will also close any Reports that are currently open.

Example

In this example, the CRPE32.DLL will not load until Execute is called:

Crpe1.LoadEngineOnUse := True;

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

Crpe1.Output := toWindow;

Crpe1.Execute;

VCL Reference

51

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