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

wOnShowGroup

wOnShowGroup takes place after one of the GroupTree nodes is clicked on, but before showing that group. This event passes the following variables:

WindowHandle

The Handle to the current Preview Window.

 

 

NGroupLevel

The number of the Group chosen. The outer group starts with number 1,

 

so if you use NGroupLevel to find the name of the Group in the

 

GroupList, be sure to decrement it by 1.

 

 

GroupList

A stringlist containing the names of the Groups starting from the outer

 

group and going up to the Group chosen.

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

 

 

Declaration

property wOnShowGroup: TCrpeShowGroupEvent;

Type

TCrpeShowGroupEvent = procedure(WindowHandle: HWnd; NGroupLevel: Word; GroupList: TStringList; var Cancel: Boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnShowGroup Event:

procedure TForm1.Crpe1wOnShowGroup(WindowHandle: Integer; NGroupLevel: Word; GroupList: TStringList; var Cancel: Boolean);

var

cnt: integer; begin

with Memo1.Lines do begin

Add('wOnShowGroup Event:');

Add(' - Group Tree was clicked ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - GroupLevel: ' + IntToStr(NGroupLevel)); Add(' - GroupList: ');

for cnt

:= 0 to (GroupList.Count

- 1)

do

Add('

' + IntToStr(cnt) +

'. '

+ GroupList[cnt]);

Add(''); end;

end;

VCL Reference

196

wOnStartEvent

wOnStartEvent takes place before the Report Engine starts a process. A process can be printing to the printer, exporting, printing to a window, or generating pages when navigating through the Preview Window. This event passes the following variables:

Destination

The destination of the current process.

 

 

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

Declaration

property wOnStartEvent: TCrpeStartEvent;

Type

TCrpeStartEvent = procedure(Destination: TCrStartEventDestination; var Cancel: Boolean) of object;

TCrStartEventDestination = (seNoWhere, seToWindow, seToPrinter, seToExport, seFromQuery);

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnStartEvent Event:

procedure TForm1.Crpe1wOnStartEvent(Destination: TCrStartEventDestination; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnStartEvent Event:'); Add(' - An Event was Started '); case Destination of

seNoWhere

: Add('

- Destination: seNoWhere');

seToWindow

: Add('

- Destination: seToWindow');

seToPrinter

: Add('

- Destination: seToPrinter');

seToExport

: Add('

-

Destination: seToExport');

seFromQuery : Add('

-

Destination: seFromQuery');

end; Add('');

end; end;

VCL Reference

197

wOnStopEvent

wOnStopEvent takes place whenever a process has finished. This event passes the following variables:

Destination

The destination of the process.

JobStatus

The status of the process.

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

 

 

Declaration

property wOnStopEvent: TCrpeStopEvent;

Type

TCrpeStopEvent = procedure(Destination: TCrStartEventDestination; JobStatus: TCrStopEventJobStatus; var Cancel: Boolean) of object;

TCrStartEventDestination = (seNoWhere, seToWindow, seToPrinter, seToExport, seFromQuery);

TCrStopEventJobStatus = (seNotStarted, seInProgress, seCompleted, seFailed, seCancelled, seHalted);

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnStopEvent Event:

procedure TForm1.Crpe1wOnStopEvent(Destination: TCrStartEventDestination; JobStatus: TCrStopEventJobStatus; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnStopEvent Event:');

Add(' - An Event was Stopped '); case Destination of

seNoWhere : Add(' - Destination: seNoWhere');

seToWindow : Add(' seToPrinter : Add(' seToExport : Add(' seFromQuery : Add('

end;

-Destination: seToWindow');

-Destination: seToPrinter');

-Destination: seToExport');

-Destination: seFromQuery');

VCL Reference

198

case JobStatus

of

seUndefined

: Add('

seNotStarted

: Add('

seInProgress

: Add('

seCompleted

: Add('

seFailed

: Add('

seCancelled

: Add('

seHalted

: Add('

end;

 

Add('');

 

end;

 

end;

 

wOnZoomLevelChange

-JobStatus: seUndefined');

-JobStatus: seNotStarted');

-JobStatus: seInProgress');

-JobStatus: seCompleted');

-JobStatus: seFailed');

-JobStatus: seCancelled');

-JobStatus: seHalted');

wOnZoomLevelChange takes place after the zoom setting is changed via the drop-down Zoom Level combo box on the button bar of the Preview Window, but before the Preview Zoom Level is actually changed. This event passes the following variables:

WindowHandle - The Handle to the current Preview Window.

ZoomLevel - This value can be a value from 25 to 400, indicating a magnification percentage, or it can be one of the following constants:

¾1 - Page Width

¾2 - Whole Page

Cancel - A variable that can be set to True to cancel the normal Preview Window response to the Event.

Declaration

property wOnZoomLevelChange : TCrpeZoomLevelChangingEvent;

Type

TCrpeZoomLevelChangingEvent = procedure(WindowHandle: HWnd; ZoomLevel: Word; var Cancel: Boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

VCL Reference

199

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