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

Description

Retrieve can be used to obtain the size of the currently open Crystal Preview Window. If there is a Preview Window open when the Retrieve method is called, the WindowSize properties will be updated with the Preview Window size and position.

Example

The following code sample runs a Report to Preview Window, then retrieves the size and position of the Window:

Crpe1.ReportName := 'MyReport.rpt';

Crpe1.Output := toWindow;

Crpe1.Execute;

Crpe1.WindowSize.Retrieve;

WindowSize Send method

Declaration

function Send : boolean;

Description

Send can be used to actively change the size and position of the currently open Crystal Preview Window. The size and position of the Preview Window will be changed to reflect the values of the Top, Left, Width and Height properties.

Example

The following code sample runs a Report to Preview Window, then changes the size and position of the Window:

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

Crpe1.Output := toWindow;

Crpe1.Execute;

Crpe1.WindowSize.Retrieve;

Crpe1.WindowSize.Top := 5;

Crpe1.WindowSize.Left := 5;

Crpe1.WindowSize.Send;

VCL Reference

706

WindowStyle Properties

WindowStyle BorderStyle property

Declaration

property BorderStyle: TCrFormBorderStyle;

Type

TCrFormBorderStyle = bsNone..bsDialog; {bsNone, bsSingle, bsSizeable, bsDialog}

Description

The BorderStyle property is of Type: TCrFormBorderStyle, which is a smaller sub-set of Delphi's TFormBorderStyle. It includes bsNone, bsSingle, bsSizeable, and bsDialog. Out of these, probably the two most useful are bsSizeable and bsNone, since the first style is best used for running the Preview Window as a stand-alone window, and the second is best used when running the Crystal Window as a child of another Delphi Form. The default BorderStyle is bsSizeable.

WindowStyle Disabled property

Declaration

property Disabled: boolean;

Description

The Disabled property can be used to disable and enable the Preview Window. When the Window is Disabled, it will still be visible, but will not react to keystrokes or mouse clicks. To hide and show the Preview Window, use the ShowWindow and HideWindow methods of TCrpe.

Disabled can be set either before or after the TCrpe.Execute method is called. If it is set after Execute, it will act on the open Preview Window.

VCL Reference

707

Example

The following example illustrates the use of the Disabled property to deactivate the Preview Window until the Report has finished processing:

Crpe1.ReportName := 'C:\Company.rpt'; Crpe1.Output := toWindow; Crpe1.WindowStyle.Disabled := True; Crpe1.Execute;

while Crpe1.Status <> 3 do Application.ProcessMessages;

Crpe1.WindowStyle.Disabled := False;

WindowStyle MaxButton property

Declaration

property MaxButton: Boolean;

Description

MaxButton controls whether the maximize button appears on the Preview Window or not. If BorderStyle is set to bsNone or bsDialog, this property is ignored because the maximize button is not available for these styles.

Example

This code sample shows how to set the WindowStyle options:

Crpe1.ReportName := 'MyReport.rpt'; Crpe1.Output := toWindow;

{Set the WindowStyle options} with Crpe1.WindowStyle do begin

BorderStyle := Sizeable; SystemMenu := True; MaxButton := True; MinButton := True;

Title := 'MyReport'; end;

Crpe1.Execute;

WindowStyle MinButton property

Declaration

property MinButton: Boolean;

VCL Reference

708

Description

MinButton controls whether the minimize button appears on the Preview Window or not. If BorderStyle is set to bsNone or bsDialog, this property is ignored because the minimize button is not available for these styles.

Example

This code sample shows how to set the WindowStyle options:

Crpe1.ReportName := 'MyReport.rpt'; Crpe1.Output := toWindow;

{Set the WindowStyle options} with Crpe1.WindowStyle do begin

BorderStyle := Sizeable; SystemMenu := True; MaxButton := True; MinButton := True;

Title := 'MyReport'; end;

Crpe1.Execute;

WindowStyle SystemMenu property

Declaration

property SystemMenu: Boolean;

Description

SystemMenu applies to the Windows system menu that appears when the top left corner of a window is clicked, or Alt-SpaceBar is pressed. This property determines if the system menu is available on the Preview Window or not. This property is ignored if the BorderStyle is set to bsNone.

Example

This code sample shows how to set the WindowStyle options:

Crpe1.ReportName := 'MyReport.rpt'; Crpe1.Output := toWindow;

{Set the WindowStyle options} with Crpe1.WindowStyle do begin

BorderStyle := Sizeable; SystemMenu := True; MaxButton := True; MinButton := True;

Title := 'MyReport'; end;

Crpe1.Execute;

VCL Reference

709

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