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

SectionFormatFormulas Properties

SectionFormatFormulas Formula property, Page 564 SectionFormatFormulas Item property, Page 565 SectionFormatFormulas ItemIndex property, Page 566 SectionFormatFormulas Name property, Page 567 SectionFormatFormulas NameIndex property, Page 570 SectionFormatFormulas Names property, Page 571 SectionFormatFormulas Section property, Page 572 SectionFormatFormulas SectionAsCode property, Page 573

SectionFormatFormulas Methods

SectionFormatFormulas Add method, Page 574 SectionFormatFormulas Check method, Page 575 SectionFormatFormulas Clear method, Page 575 SectionFormatFormulas CopyFrom method, Page 576 SectionFormatFormulas Count method, Page 577 SectionFormatFormulas Create method, Page 577 SectionFormatFormulas Delete method, Page 578 SectionFormatFormulas Destroy method, Page 578 SectionFormatFormulas IndexOf method, Page 579 SectionFormatFormulas IndexOfName method, Page 580 SectionFormatFormulas NameCount method, Page 582 SectionFormatFormulas Retrieve method, Page 583 SectionFormatFormulas SectionType method, Page 584 SectionFormatFormulas Send method, Page 585

SectionHeight

Declaration

property SectionHeight: TCrpeSectionHeight;

Type

TCrpeSectionHeight = class(TPersistent)

VCL Reference

98

Description

SectionHeight controls the minimum height of each section in the Report. It can be used to expand the size of a Section. Its main properties and methods are as follows:

The Retrieve method can be used to obtain the SectionHeight information from a Report.

The Height property specifies the minimum Section height. The height is in twips, but these can be converted to inches by the following formula: Inches := Twips / 1440;

As on most of the other Crystal component objects, the default array property, Item, or the ItemIndex property can be used to navigate the object through the Sections.

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).

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

NOTE: If a SectionHeight value is specified which is less than the actual Section height, it will be ignored when the Report is run. SectionHeight checks the current height of each Section, and then sends in the SectionHeight values only if they are larger than the current height of the Section.

SectionHeight Example

The code below retrieves the SectionHeight settings from the Report, then loops through looking for the Details "a" section and sets the Height for that section:

var

cnt: integer; begin

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

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

{Look for Details area}

if Crpe1.SectionHeight[cnt].Section = 'Da' then Crpe1.SectionHeight[cnt].Height := 400;

end;

Crpe1.Output := toWindow; Crpe1.Execute;

end;

The following example sets the Section height for the first section of the Report to 400 twips:

Crpe1.ReportName := 'MyReport.rpt';

Crpe1.SectionHeight.Retrieve;

Crpe1.SectionHeight[0].Height := 400;

Crpe1.Output := toWindow;

Crpe1.Execute;

VCL Reference

99

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