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

WindowStyle Title property

Declaration

property Title: string;

Description

The Title property contains the string that will appear in the Preview Window Title Bar, which is normally called the window Caption. If the BorderStyle is set to bsNone, this property will be ignored because windows with no border should not have a caption.

Title is an "active" property. If it is changed while a Preview Window is open, the Window will be updated immediately.

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 Methods

WindowStyle Clear method

Declaration

procedure Clear;

VCL Reference

710

Description

This method clears the WindowStyle properties by setting them to default:

BorderStyle := bsSizeable; ControlBox := True; MaxButton := True; inButton := True;

Title := '';

It is called automatically if the Clear method is called for the main component, but may be called in code as needed.

Example

This line of code clears the WindowStyle properties:

Crpe1.WindowStyle.Clear;

WindowStyle CopyFrom method

Declaration

function CopyFrom(Source: TCrpeWindowStyle): boolean;

Description

The CopyFrom method copies the WindowStyle property values from another TCrpeWindowStyle 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 WindowStyle property values to a temporary TCrpeWindowStyle object:

var

tempWindowStyle : TCrpeWindowStyle; begin

tempWindowStyle := TCrpeWindowStyle.Create; tempWindowStyle.CopyFrom(Crpe1.WindowStyle); {...later, when finished with the temp object...} tempWindowStyle.Free;

end;

VCL Reference

711

WindowStyle Create method

Declaration

constructor Create;

Description

The Create method is used internally in the Crystal component to create the WindowStyle object, and does not need to be called in code.

WindowZoom Properties

WindowZoom Magnification property

Declaration

property Magnification: TCrZoomMagnification;

Type

TCrZoomMagnification = -1..400;

Description

The Magnification property controls the zoom level of a Report Preview Window. The acceptable values are: 0,1,2 : Same as the Preview enumerated values (pwNormal, pwPageWidth, pwWholePage)

25 to 400 : Magnification by percentage

-1, 3 to 24 : Default Magnification used (no change)

NOTE: The ZoomMagnification range goes down to -1 because -1 is used as a standard numeric default value throughout Delphi and throughout the Crystal component. However, in this case, any value below 25 (except 0,1, or 2) will be counted as default, ie. the property will be ignored.

Example

This example sets the zoom magnification level of the Preview Window to 50 percent:

Crpe1.WindowZoom.Magnification := 50;

VCL Reference

712

WindowZoom Preview property

Declaration

property Preview: TCrZoomPreview;

Type

TCrZoomPreview = (pwNormal, pwPageWidth, pwWholePage, pwDefault);

Description

The Preview property sets the zoom level of a Report Preview Window to a pre-defined level:

pwNormal

= Equivalent to 100% magnification.

pwPageWidth

= The Report will be sized to fit the width of the Preview Window.

pwWholePage

= The Report will be sized to fit the width and height of the Preview Window.

pwDefault

= The Preview property is ignored. The zoom level will be determined by the level

 

the Report was saved with, or the setting of the Magnification property.

The property may be set in code, either before or after the Execute method. If it is used after Execute, it will immediately act on the currently open Preview Window.

Example

This example sets the Preview Window zoom level so that the Report will be sized to the width and height of the window:

Crpe1.WindowZoom.Preview := pwWholePage;

WindowZoom Methods

WindowZoom Clear method

Declaration

procedure Clear;

Description

This method can be used to set the WindowZoom properties to their default values:

Preview := pwDefault;

Magnification := -1;

It is called automatically if the Clear method is called for the main component, but may be called in code as needed.

VCL Reference

713

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