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

report. If you connected to Xtreme sample data, select the Customer table and click Add.

6Continue selecting tables and clicking Add. Click Done when finished. The selected tables appear in the Data Tab of the Create Report Expert. If you selected more than one table, the Linking Tab will appear.

7Proceed to design your report using the selected data.

PC Databases

This tutorial demonstrates how to connect to a Btrieve, xBase, Paradox, or Access database. Assuming you have clicked Custom on the Data Tab of the Create Report Expert:

1From the Log On Server dialog box, click Database File. The Choose Database File dialog box appears.

2Use the Choose Database File dialog box to locate and select the database file you want to use in your report, then click Add.

3Continue selecting database files and clicking Add for every database you wish to use in your report.

4Click Done when finished selecting databases. You will return to the Create Report Expert, and the Linking Tab will be activated.

5Use the Linking Tab to specify links between database tables.

6Continue designing your report.

Report Designer Overview

This section provides a brief explanation of what the Seagate Crystal Report Designer Component is and how it works with Visual Basic. An understanding of this material is not crucial to using the Report Designer Component, but it will help you understand how the designer works with Visual Basic and your data at both design time and runtime.

What is the Report Designer Component?

Report Designer Architecture

Visual Basic Environment (Design Time)

Visual Basic Environment (Runtime or Application EXE)

Component Descriptions

Dual - Interface

Introduction to the Report Designer Component

The Seagate Crystal Report Designer Component is an ActiveX designer which provides a design window inside of the Visual Basic Integrated Development Environment (IDE). An ActiveX designer component has a design window which allows visual modification of the object. At runtime, the object may take on a new appearance and behavior. A good example of a design object is the standard Visual Basic Form designer which

The Report Designer Component

169

provides a rich design time environment where you can add controls and other objects to the Form object to create a more sophisticated object that has a similar look but different behavior at runtime.

ActiveX designers created by Microsoft and other, third-party vendors work much like standard design objects but can be plugged in to Visual Basic or any other development environment that supports such designers. These components help expand what you can do with VB while behaving in a consistent fashion with the rest of the Visual Basic IDE.

The Report Designer Component is an ActiveX designer that specializes in simplifying reporting tasks such as connecting to Visual Basic project data and formatting and modifying report fields. In addition to making reporting in Visual Basic easier, the designer also exposes the Report Designer Component object library. This gives the Report Designer Component a simple design time interface with very powerful runtime capabilities.

Report Designer Architecture

The Seagate Crystal Report Designer Component includes several COM objects that work with the Visual Basic design and runtime environments. The following sections describe this interaction. For complete descriptions of all of the components in the Report Designer architecture, see Component Descriptions, Page 172.

The following topics are discussed in this section:

Design Time, Page 170

Runtime, Page 171

Component Descriptions, Page 172

Dual - Interface, Page 173

Design Time

At design time, the Report Designer Component provides a user interface that closely integrates with the Visual Basic IDE. Through the user interface, you design and manipulate reports and report data. This interface includes events that can be directly programmed from within Visual Basic.

The Report Designer Component uses the Active Data Driver(see Active Data Driver, Page 118) for connecting to ISAM, ODBC, and SQL databases through Data Access Objects (DAO), Remote Data Objects (RDO), ActiveX Data Objects (ADO), and Data Environments (Visual Basic 6.0 only). You can design the data set from within Visual Basic, then apply it to the report contained by the Report Designer Component.

When working in Visual Basic, you will often need to use the Seagate Crystal Report Smart Viewer for ActiveX as a user interface to display reports. The Smart Viewer is an ActiveX control that you can drop right on to a standard Visual Basic Form. The Smart Viewer is, ultimately, where your report is displayed at runtime.

The Report Designer Component

170

This is a diagram illustrating design time relationship with Visual Basic. Red arrows (1) indicate methods, properties and events that VB developers can manipulate directly; Green arrows (2) indicate internal communications between Crystal components.

Runtime

The user interface provided by the Report Designer Component at design time does not appear in your application at runtime, or when it is compiled into an executable file. Instead, the Report Designer Component is accessed directly by your Visual Basic code. The Report Designer object model provides a complete object hierarchy for direct manipulation in Visual Basic.

The Active Data Driver is also available at runtime, through the Report object of the Report Designer Component object model, and can be assigned a new set of data based on user interaction with your application. You design a Recordset or Resultset object in Visual Basic using the DAO, RDO, or ADO object model, and pass it to the report.

Finally, the Smart Viewer takes center stage at runtime, connecting to the Report Designer Component and displaying the embedded report. With careful design and placement on the Form, the Smart Viewer appears simply as a window inside your application.

The Report Designer Component

171

This is a diagram illustrating the runtime relationship with Visual Basic. Red arrows (1) indicate methods, properties and events that VB developers can manipulate directly; Green arrows (2) indicate internal communications between Crystal components.

Component Descriptions

Component

Description

 

 

 

 

Crystal Report Designer

This is a COM (Component Object Model) component that provides the

UI Component

user interface at design time for the user to interact with and create or

 

modify the report.

 

 

Crystal Report Designer

This is an underlying COM component that provides services for the user

Design Time Component

interface component.

Crystal Report Designer

This is the component that encapsulates all of the report objects and is

Run Time Component

responsible for doing all of the data processing and report layout.

 

 

Active Data Driver

This is a data access driver that provides access to various types of object

 

data sources including DAO, RDO, and ADO.

Crystal Reports Smart

This component is an Active X control which can be drawn on a form and

Viewer for ActiveX

manipulated at design time. It provides a rich object model which can be

 

used to modify user interaction with the report at runtime. This

 

component is required only if a developer wants to provide on-screen

 

display of reports at runtime.

The Report Designer Component

172

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