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

Description

The About property is the first property in the Object Inspector and launches a dialog box which shows the Version number of the Crystal Reports Component. The Version number is divided into four parts, i.e.:

7.4.0.0

The first number represents the highest Seagate Crystal Reports version supported:

5=SCR 5 6=SCR 6 7=SCR 7

The second number represents the Delphi version:

2=Delphi 2 3=Delphi 3 4=Delphi 4

The third number represents the VCL release version:

0=First release

The fourth number represents the release build-version:

0=First release build

AreaFormat

Declaration

property AreaFormat: TCrpeAreaFormat;

Type

TCrpeAreaFormat = class(TPersistent)

Description

AreaFormat controls how the area sections of a Report behave. It is similar to SectionFormat, except that SectionFormat applies to individual sub-sections, whereas AreaFormat works on all of the sections of the same type at once.

The Section naming format has been adopted from the Crystal Reports "short" section naming convention, so RH means ReportHeader, GH3 means GroupHeader 3, etc. See About Section Names, Volume 1, Chapter 7, for more information.

If the Retrieve method is used to get the Area information from the Report, the AreaFormat object will be automatically populated with valid area section names, which appear in the Section property.

VCL Reference

7

If the manual Add method is used instead, the programmer will have to specify which section to add to the object.

The Count, Item, and ItemIndex properties can be used to navigate through the different section items in the AreaFormat object.

The Hide property will cause a section to be hidden, although drill-down is still possible. To suppress a section so that it is not processed, and is not available for drill-down, use the Suppress property.

The KeepTogether property will prevent a section from splitting on a page break. This is not the same as KeepGroupTogether, which is available via the KeepTogether property of the GroupOptions object.

The NewPageAfter and NewPageBefore properties determine if a page break will happen after or before a particular section.

The PrintAtBottomOfPage property will cause the section to appear at the bottom of the page.

The ResetPageNAfter property will cause the Page Number to be reset after a particular section.

The SectionAsCode property offers the ability to treat the Section name as a Section Code Number, which can be useful for doing mathematical expressions to filter out certain sections.

The SectionType method returns just the first characters of the Section name, so for GH1 (Group Header 1), the SectionType would be GH (Group Header).

Limitations

For Report Header (RH) areas, the NewPageBefore property does not apply.

For Report Footer (RF) areas, the NewPageAfter property does not apply.

For Page Header (PH) and Page Footer (PF) areas, the following options do not apply (setting them will have no effect on the Report):

Hide

KeepTogether

NewPageAfter

NewPageBefore

PrintAtBottomOfPage

AreaFormat 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

VCL Reference

8

{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;

The following example hides the Details area of a Report:

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

Crpe1.AreaFormat.Retrieve;

Crpe1.AreaFormat.Section := 'D';

Crpe1.AreaFormat.Hide := True;

Crpe1.Output := toWindow;

Crpe1.Execute;

AreaFormat Properties

AreaFormat Hide property, Page 214

AreaFormat Item property, Page 215

AreaFormat ItemIndex property, Page 215

AreaFormat KeepTogether property, Page 216

AreaFormat NewPageAfter property, Page 217

AreaFormat NewPageBefore property, Page 218

AreaFormat PrintAtBottomOfPage property, Page 218

AreaFormat ResetPageNAfter property, Page 219

AreaFormat Section property, Page 220

AreaFormat SectionAsCode property, Page 221

AreaFormat Suppress property, Page 222

VCL Reference

9

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