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

AreaFormat NewPageBefore property

Declaration

property NewPageBefore: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

NewPageBefore determines if a Page Break will occur before the specified Area.

Example

The code below retrieves the AreaFormat settings from the Report, then loops through looking for the Details area, and sets the NewPageBefore option for that area:

var

cnt: integer; begin

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

for cnt := 0 to (Crpe1.AreaFormat.Count - 1) do begin

{Look for Details area}

if Crpe1.AreaFormat[cnt].Section = 'D' then Crpe1.AreaFormat[cnt].NewPageBefore := cDefault;

end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

AreaFormat PrintAtBottomOfPage property

Declaration

property PrintAtBottomOfPage: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

VCL Reference

218

Description

PrintAtBottomOfPage determines if the specified Area will appear at the bottom of the page when the Report is run.

Example

The code below retrieves the AreaFormat settings from the Report, then loops through looking for the Details area, and sets the PrintAtBottomOfPage option for that area:

var

cnt: integer; begin

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

for cnt := 0 to (Crpe1.AreaFormat.Count - 1) do begin

{Look for Details area}

if Crpe1.AreaFormat[cnt].Section = 'D' then Crpe1.AreaFormat[cnt].PrintAtBottomOfPage := cTrue;

end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

AreaFormat ResetPageNAfter property

Declaration

property ResetPageNAfter: TCrBoolean;

Type

TCrBoolean = (cFalse, cTrue, cDefault);

Description

ResetPageNAfter determines if the Page Number will be reset back to 1 after the specified Area.

VCL Reference

219

Example

The code below retrieves the AreaFormat settings from the Report, then loops through looking for the Details area, and sets the ResetPageNAfter option for that area:

var

cnt: integer; begin

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

for cnt := 0 to (Crpe1.AreaFormat.Count - 1) do begin

{Look for Details area}

if Crpe1.AreaFormat[cnt].Section = 'D' then Crpe1.AreaFormat[cnt].ResetPageNAfter := cTrue;

end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

AreaFormat Section property

Declaration

property Section: TCrAreaFormatSection;

Type

TCrAreaFormatSection = string;

Description

The Section property contains the Section name of the item that the AreaFormat object is currently pointed to. It's primary use is as a look-up property to point the AreaFormat object to the item with the Section specified. The default array property, Item, however, provides an easier way to navigate through the object.

If the Retrieve method is used, the Section name of each AreaFormat item is automatically filled when the AreaFormat information is retrieved.

The Section name syntax is the same as the Short Section Names used in the Crystal Reports Designer:

RH - Report Header

PH - Page Header

GH - Group Header

D - Details

GF - Group Footer

PF - Page Footer

RF - Report Footer

Numbers are used to designate different Groups: GH1, GF2, etc. See g for more details on the syntax.

VCL Reference

220

NOTE: Whereas objects such as SectionFormat and SectionFormatFormulas work on specific individual subsections, such as Details "a", Details "b", etc., AreaFormat and AreaFormatFormulas work on certain areas, for example, Details area. The options set in these objects affect all the sub-sections of that Area as a unit.

Example

The code below retrieves the AreaFormat settings from the Report, then loops through looking for the Details area, and sets various options for that area:

var

cnt: integer; begin

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

for cnt := 0 to (Crpe1.AreaFormat.Count - 1) do begin

{Look for Details area}

if Crpe1.AreaFormat[cnt].Section = 'D' then begin

Crpe1.AreaFormat[cnt].Hide := cFalse; Crpe1.AreaFormat[cnt].KeepTogether := cTrue; Crpe1.AreaFormat[cnt].NewPageAfter := cDefault; Crpe1.AreaFormat[cnt].NewPageBefore := cDefault; Crpe1.AreaFormat[cnt].PrintAtBottomOfPage := cFalse; Crpe1.AreaFormat[cnt].ResetPageNAfter := cTrue; Crpe1.AreaFormat[cnt].Suppress := cFalse;

end; end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

AreaFormat SectionAsCode property

Declaration

property SectionAsCode: smallint;

Description

The SectionAsCode property can be used to read and write the Section property via Print Engine Section Code numbers. Since the Print Engine Section Codes are numeric, it is easier to apply conditional formatting to certain sections (in a For loop for example) based on mathematical calculations on the Section Code number than it is by parsing out the regular Section Code string (GH1, etc.).

VCL Reference

221

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