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

GraphText Properties

GraphText FootNote property, Page 328 GraphText GroupsTitle property, Page 328 GraphText Item property, Page 329 GraphText ItemIndex property, Page 330 GraphText Number property, Page 330 GraphText Section property, Page 331 GraphText SectionAsCode property, Page 332 GraphText SeriesTitle property, Page 333 GraphText SubTitle property, Page 334 GraphText Title property, Page 334 GraphText XAxisTitle property, Page 335 GraphText YAxisTitle property, Page 335 GraphText ZAxisTitle property, Page 336

GraphText Methods

GraphText Add method, Page 337 GraphText Clear method, Page 338 GraphText CopyFrom method, Page 338 GraphText Count method, Page 339 GraphText Create method, Page 339 GraphText Delete method, Page 340 GraphText Destroy method, Page 340 GraphText Retrieve method, Page 340 GraphText SectionType method, Page 341 GraphText Send method, Page 342

GraphType

Declaration

property GraphType: TCrpeGraphType;

Type

TCrpeGraphType = class(TPersistent)

VCL Reference

36

Description

The GraphType object contains the properties and methods needed to change the style of the Graphs that are in a Report.

The Number property specifies the Graph Number, and can be used as a lookup value to point the GraphType object to a specific GraphType item. See How Graphs are Numbered, Page 37, for more information on the numbering scheme.

The Section property specifies the section that the Graph is located in, and uses the "short" section naming convention used in the Crystal Reports Designer. See About Section Names, Volume 1, Chapter 7, for more information.

The Style property specifies the actual Graph Type.

The Retrieve property can be used to fill the GraphType object with information about each Graph.

Alternatively, the manual Add method can also be used, but the actual Graph Number, as well as the Section it is in, will need to be specified.

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

How Graphs are Numbered

The Crystal Reports Print Engine numbers Graphs from top to bottom and left to right within a section. Therefore, it is possible to have more than one Graph with the same number, since they reside in different sections. This is why it is necessary to specify both a Graph Number and a Graph Section for each Graph that will be changed. In the Crystal Reports VCL component, there are two ways of dealing with Graph numbering:

The Retrieve method

If the Retrieve method is used for obtaining Graph information (GraphType, GraphText, GraphOptions, GraphData) from a Report, then the Crystal component stores the actual Print Engine Graph Number internally, and uses a modified numbering system for the Number property, whereby the Graphs are numbered per Report, and not per Section. In this way, each Graph has a unique Number value. The Section property still shows the proper Section value, but the Graphs are numbered uniquely, so there are no duplicates. This was necessary so that Number could be used as a lookup property in the Object Inspector.

The Add method

If the Add method is used to manually add an Graph item to one of the VCL component's Graph objects (GraphType, GraphData, GraphOptions, GraphText), then the original Print Engine numbering scheme should be used. This requires that the developer have a good knowledge of what each Report contains, and where the Graphs are placed.

It is recommended that the Retrieve method be used as much as possible, as it is less error-prone, does not require the developer to know before-hand the actual Graph number and Section for each Graph, and is easier to deal with (i.e. no duplicate numbers).

VCL Reference

37

GraphType Example

This example retrieves the GraphType information from the Report and then changes the Style to 3D Bars:

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

if Crpe1.GraphType.Count > 0 then begin

Crpe1.GraphType[0].Style := ThreeDBars; Crpe1.Execute;

end;

GraphType Properties

GraphType Item property, Page 343

GraphType ItemIndex property, Page 343

GraphType Number property, Page 344

GraphType Section property, Page 345

GraphType SectionAsCode property, Page 346

GraphType Style property, Page 346

GraphType Methods

GraphType Add method, Page 348

GraphType Clear method, Page 349

GraphType CopyFrom method, Page 349

GraphType Count method, Page 350

GraphType Create method, Page 350

GraphType Delete method, Page 351

GraphType Destroy method, Page 351

GraphType Retrieve method, Page 351

GraphType SectionType method, Page 352

GraphType Send method, Page 353

VCL Reference

38

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