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

Type

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

Description

The ZoomMode property controls the zoom level of the Crystal Preview Window when it first appears on screen.

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 ZoomMode property is ignored. The zoom level will be determined by the

 

level the Report was saved with, or the setting of the WindowZoom.Preview or

 

WindowZoom.Magnification properties.

 

 

Example

This example sets the ZoomMode property of ReportOptions:

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

Crpe1.ReportOptions.ZoomMode := pwWholePage;

Crpe1.WindowState := wsMaximized;

Crpe1.Output := toWindow;

Crpe1.Execute;

ReportOptions Methods

ReportOptions Clear method

Declaration

procedure Clear;

Description

The Clear method can be used to set the ReportOptions properties back to their default values:

CaseInsensitiveSQLData := cDefault;

ConvertDateTimeTyp := dtDefault;

ConvertNullFieldToDefault := cDefault;

CreateGroupTree := cDefault;

NoDataForHiddenObjects := cDefault;

VCL Reference

524

PerformGroupingOnServer := cDefault;

PrintEngineErrorMessages : = cDefault;

SaveDataWithReport := cDefault;

SaveSummariesWithReport := cDefault;

TranslateDOSMemos := cDefault;

TranslateDOSStrings := cDefault;

UseIndexForSpeed := cDefault;

VerifyOnEveryPrint := cDefault;

ZoomMode := pwDefault;

It is called automatically if the Clear method is called for the main component, or if a new Report name is assigned to the ReportName property, but may be called in code as needed.

Example

This line of code clears the ReportOptions properties:

Crpe1.ReportOptions.Clear;

ReportOptions CopyFrom method

Declaration

function CopyFrom(Source: TCrpeReportOptions): boolean;

Description

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

var

tempReportOptions : TCrpeReportOptions; begin

tempReportOptions := TCrpeReportOptions.Create; tempReportOptions.CopyFrom(Crpe1.ReportOptions); {...later, when finished with the temp object...} tempReportOptions.Free;

end;

VCL Reference

525

ReportOptions Create method

Declaration

constructor Create;

Description

The Create method is used internally in the Crystal component to create the ReportOptions object, and does not need to be called in code, unless you are using the CopyFrom method to store ReportOptions data to a temporary object:

var

tempReportOptions : TCrpeReportOptions; begin

tempReportOptions := TCrpeReportOptions.Create; tempReportOptions.CopyFrom(Crpe1.ReportOptions);

end;

ReportOptions Retrieve method

Declaration

function Retrieve: boolean;

Description

The Retrieve method obtains the ReportOptions information from the Report and stores it in the ReportOptions object. If ReportOptions information was not found, the call returns False.

Example

The following code illustrates the use of the Retrieve method. ReportOptions belong to the main Report, therefore it is not necessary to retrieve them from Subreports also:

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

Crpe1.ReportOptions.Retrieve;

VCL Reference

526

ReportOptions Send method

Declaration

function Send: boolean;

Description

The Send method sends the ReportOptions values to the Crystal Reports Print Engine. This method is called automatically when the Execute method is called, provided that SendOnExecute is set to True.

We strongly recommend that you leave SendOnExecute to True, and let the Crystal Reports component send the values to the Print Engine. If you set the SendOnExecute property to False, each Sub-class and each property that does not belong to a Sub-class must be manually sent before calling the Execute method. This feature is mainly provided for debugging purposes.

Example

In this example, the ReportOptions settings are sent from the Crystal component to the Crystal Reports Print Engine DLL. This is normally handled automatically in the Execute method:

Crpe1.ReportOptions.Send;

SectionFont Properties

SectionFont CharSet property

Declaration

property CharSet: TCrFontCharSet;

Type

TCrFontCharSet = (fcAnsi, fcDefault, fcSymbol, fcShiftJis, fcHangeul, fcChineseBig5, fcOEM);

Description

CharSet determines the Character Set that is used for the Font in the specified Section. Use fcDefault for no change.

VCL Reference

527

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