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

Formulas Delete method, Page 297

Formulas Destroy method, Page 298

Formulas IndexOf method, Page 298

Formulas Retrieve method, Page 299

Formulas Send method, Page 300

GraphData

Declaration

property GraphData: TCrpeGraphData;

Type

TCrpeGraphData = class(TPersistent)

Description

The GraphData object contains the properties and methods required to change the data that a Graph is based on.

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 Retrieve method can be used to fill the GraphData object with information from the Report.

The Count method will indicate the number of GraphData items currently stored in the GraphData object.

The Item, and ItemIndex properties can be used to navigate through the GraphData items in the GraphData object.

The RowGroupN property specifies which Group number in the report is used to create the values in the rows of the Graph. Use -1 for default. Group numbers start with 1.

The ColGroupN property specifies which Group number in the report is used to create the values in the columns of the Graph. Use -1 for Default. Group numbers start with 1.

The SummarizedFieldN property specifies which Summary field in the report is used to set the values of the risers in the Graph. Summary fields are numbered in order of their creation. Use -1 for default. Summary Field numbers start with 0.

VCL Reference

30

The Direction property is used to specify in what direction a Graph will read its data from the Report. For normal Group/Total Graph, the Direction, is always Cols. For Cross-Tab Graphs, use any of the following TCrGraphDirection values:

TCrGraphDirection

Meaning

 

 

Rows

Use only row values in graph.

 

 

Cols

Use only column values in graph.

 

 

RowCol

Graph by row values, then by column values.

 

 

ColRow

Graph by column values, then by row values.

 

 

Unknown

The direction of the graph is unknown.

 

 

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

NOTE: Graphs based on Formulas or Details instead of Groups, will not have GraphData.

GraphData Example

The sample code below illustrates the use of the GraphData object to change the Summary Field that the Graph is based on:

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

if Crpe1.GraphData.Count > 0 then Crpe1.GraphData[0].SummarizedFieldN := 1;

Crpe1.Execute;

GraphData Properties

GraphData ColGroupN property, Page 301

GraphData Direction property, Page 301

GraphData Item property, Page 302

GraphData ItemIndex property, Page 303

GraphData Number property, Page 304

GraphData RowGroupN property, Page 305

GraphData Section property, Page 305

GraphData SectionAsCode property, Page 306

GraphData SummarizedFieldN property, Page 307

VCL Reference

31

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