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

Type

TCrMarginTwips = -2..PE_SM_DEFAULT;

Constant

PE_SM_DEFAULT = $8000; {32768 in decimal}

Description

The Bottom property determines the bottom margin of the Report. It is listed in Twips (1 inch = 1440 twips). The property can be assigned any number from 0 to 32767, or -1 to use the current margin value as contained in the Report, or -2 (same effect as 32768) for a default margin value based on the current Printer.

Example

The code below sets the Bottom Margin:

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

Crpe1.Margins.Bottom := 20;

Crpe1.Execute;

Margins Left property

Declaration

property Left: TCrMarginTwips;

Type

TCrMarginTwips = -2..PE_SM_DEFAULT;

Constant

PE_SM_DEFAULT = $8000; {32768 in decimal}

Description

The Left property determines the left margin of the Report. It is listed in Twips (1 inch = 1440 twips). The property can be assigned any number from 0 to 32767, or -1 to use the current margin value as contained in the Report, or -2 (same effect as 32768) for a default margin value based on the current Printer.

VCL Reference

427

Example

The code below sets the Left Margin:

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

Crpe1.Margins.Left := 20;

Crpe1.Execute;

Margins Right property

Declaration

property Right: TCrMarginTwips;

Type

TCrMarginTwips = -2..PE_SM_DEFAULT;

Constant

PE_SM_DEFAULT = $8000; {32768 in decimal}

Description

The Right property determines the right margin of the Report. It is listed in Twips (1 inch = 1440 twips). The property can be assigned any number from 0 to 32767, or -1 to use the current margin value as contained in the Report, or -2 (same effect as 32768) for a default margin value based on the current Printer.

Example

The code below sets the Right Margin:

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

Crpe1.Margins.Right := 20;

Crpe1.Execute;

Margins Top property

Declaration

property Top: TCrMarginTwips;

Type

TCrMarginTwips = -2..PE_SM_DEFAULT;

VCL Reference

428

Constant

PE_SM_DEFAULT = $8000; {32768 in decimal}

Description

The Top property determines the top margin of the Report. It is listed in Twips (1 inch = 1440 twips). The property can be assigned any number from 0 to 32767, or -1 to use the current margin value as contained in the Report, or -2 (same effect as 32768) for a default margin value based on the current Printer.

Example

The code below sets the Top Margin:

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

Crpe1.Margins.Top := 20;

Crpe1.Execute;

Margins Methods

Margins Clear method

Declaration

procedure Clear;

Description

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

Left := -1;

Right := -1;

Top := -1;

Bottom := -1;

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 Margins properties:

Crpe1.Margins.Clear;

VCL Reference

429

Margins CopyFrom method

Declaration

function CopyFrom(Source: TCrpeMargins): boolean;

Description

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

var

tempMargins : TCrpeMargins; begin

tempMargins := TCrpeMargins.Create; tempMargins.CopyFrom(Crpe1.Margins);

{...later, when finished with the temp object...} tempMargins.Free;

end;

Margins Create method

Declaration

constructor Create;

Description

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

Margins Retrieve method

Declaration

function Retrieve: boolean;

VCL Reference

430

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