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

SetDataSource Method (Database Object)

The SetDataSource method is used to provide information about a data source to the database driver associated with this Database object. For instance, if a report has been designed using the Crystal Active Data Driver this method can be used to provide an active data source for the report, such as a DAO, ADO, or RDO Recordset or a CDO Rowset. In this case, the object passed to the second parameter of this method replaces, at runtime, the field definition file used to create the report. This method can be invoked only in formatting Idle mode.

Syntax

[form]Object.SetDataSource data

Parameters

Parameter

Description

 

 

 

 

Data

Variant data passed to the database driver. For example, with Active data, this must be

 

a Recordset object if you are using DAO, ADO, or the Visual Basic data control. This

 

must be a Rowset object if you are using CDO.Description.

DataTag

A value indicating the type of data being passed to the DatabaseTable object in the

 

Data parameter. Currently, the only possible value is 3. This value must be used for all

 

Active data sources including DAO, ADO, RDO, CDO, and the Visual Basic data

 

control.

TableNumber

Specifies the index number of the table to be set.

(optional)

 

 

 

Verify Method (Database Object)

The Verify method verifies that the location of the database is still valid and checks to see if any changes have been made to table design, etc. If there are any changes to the database, the Verify method will update the report automatically to reflect these changes. This method can be invoked only in formatting Idle mode.

Syntax

object.Verify

DatabaseFieldDefinition Object

The DatabaseFieldDefinition Object represents a database field used in the report. This object provides properties for getting information on database fields in the report.

Report Designer Component Object Model

33

DatabaseFieldDefinition Object Properties

Property

Definition

Read/Write

Restriction in

event handler

 

 

 

 

 

 

 

 

 

 

 

DatabaseFieldName

Specifies the name of the field in the database

Read only

None

 

(that is, Product ID).

 

 

 

 

 

 

Kind

Returns CRFieldKind which specifies what

Read only

None

 

“kind” of field (that is, database, summary,

 

 

 

formula, etc.).

 

 

 

 

 

 

Constant

Value

 

 

 

 

crDatabaseField

1

 

 

crFormulaField

2

 

 

crGroupNameField

5

crParameterField

6

 

 

crRunningTotalField

7

 

 

crSpecialVarField

4

 

 

crSQLExpressionField

8

crSummaryField

3

 

 

Property

Description

Read/Write

Restriction in event handler

 

 

 

 

 

 

 

 

Name

Returns the name of the

Read only

None

 

field within the report

 

 

 

(table.FIELD). For

 

 

 

example,

 

 

 

product.PRODUCT ID.

 

 

 

 

 

 

NextValue

Returns field next value.

Read only

Can be read only when top-level

 

 

 

Report object is formatting active.

 

 

 

 

NumberOfBytes

Returns the number of

Read only

None

 

bytes required to store

 

 

 

the field data in memory.

 

 

 

 

 

 

Parent

Reference to the Parent

Read only

None

 

object Report Object

 

 

 

(page 93)).

 

 

 

 

 

 

PreviousValue

Returns field previous

Read only

Can be read only when top-level

 

value.

 

Report object is formatting active.

 

 

 

 

TableAliasName

Returns the table alias

Read only

Can be written only when

 

name the field is in.

 

formatting idle.

 

 

 

 

Report Designer Component Object Model

34

Property

Description

Read/Write

Restriction in event handler

 

 

 

 

 

 

 

 

Value

Returns field value.

Read only

Can be read only when top-level

 

 

 

Report object is formatting active.

ValueType

Returns

Read only

None

 

CRFieldValueType (see

 

 

 

table below) which

 

 

 

specifies the “type” of

 

 

 

value found in the field.

 

 

 

 

 

 

Constant

Value

 

 

 

 

crBitmapField

17

 

 

crBlobField

15

 

 

crBooleanField

9

 

 

crChartField

21

crCurrencyField

8

 

 

crDateField

10

 

 

crDateTimeField

16

 

 

crIconField

18

crInt16sField

3

 

 

crInt16uField

4

 

 

crInt32sField

5

 

 

crInt32uField

6

 

 

crInt8sField

1

crInt8uField

2

 

 

crNumberField

7

 

 

crOleField

20

 

 

crPersistentMemoField

14

crPictureField

19

 

 

crStringField

12

 

 

crTimeField

11

 

 

crTransientMemoField

13

crUnknownField

22

Report Designer Component Object Model

35

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