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

Introduction

Why you

should read this chapter

A note to developers

Seagate Crystal Reports can access data stored in almost any common database format, as well as many uncommon formats. In addition, Seagate Crystal Reports leverages the full benefits of query (.QRY) files and dictionaries (.DC5). See Queries, Page 467, and Dictionaries, Page 491.

This section discusses the many different types of data that Seagate Crystal Reports can access and explains the data access layers involved in connecting to the data. If you are not sure what Database Management System (DBMS) your company uses, contact your IS manager or network administrator.

The principal purpose of Seagate Crystal Reports is simply to access data stored in databases and produce reports on that data. This goal is one of the oldest uses of computers and remains one of the most common and necessary. Seagate Crystal Reports is designed to make that task easier, less time consuming, and more powerful.

This idea of accessing data remains at the root of every report produced. By understanding how Seagate Crystal Reports accesses data, you will gain a better knowledge of the reporting process as well as a better knowledge of the type of data that the program can work with.

In addition, understanding the data access process will help you troubleshoot problems you may encounter while trying to open a particular database file. This is especially useful for IS managers and anyone providing data access support for a group of users.

Most of the information in this section is designed for experienced Seagate Crystal Reports users and IS managers and covers technical aspects of Database Management Systems (DBMS) and data storage techniques. A familiarity with computers, the Windows, Windows 95, or Windows NT operating system, and at least one DBMS application is assumed.

This section concentrates on the principles of data access. However, most of the same concepts can be applied to any application accessing data through the Crystal Report Engine, or

584

Seagate Crystal Reports User’s Guide

any of the Crystal Report Engine development tools described in the Technical Reference. For that reason, Seagate Crystal Reports, as used in this section, refers both to the application and the Report Engine unless otherwise specified.

NOTE: Most of the file names mentioned in this chapter are for the 16-bit version of the program unless otherwise specified. File names for 32-bit version are similar, but will have some aspect indicating 32-bit. For example, PDSODBC.DLL is the 16-bit ODBC translation file, while P2SODBC.DLL is the 32-bit ODBC translation file.

Four types of data

The type of data that Seagate Crystal Reports can access falls into four general categories:

1.Direct access database files, Page 585

2.ODBC data sources, Page 606

3.Crystal Query Designer files, Page 623

4.Crystal Dictionary files, Page 624

Each type of data must be accessed using a specific set of DLLs and other data access related files. Once you understand the process the program uses to access each type of data, you will have a better understanding of the report creation process and the elements used to turn your data into powerful reports. See

Queries, Page 467, and Dictionaries, Page 491.

NOTE: When accessing any type of data, Seagate Crystal Reports relies on the database drivers to provide field names, field types, and field lengths. This information is provided by either the database engine or the ODBC database driver.

Direct access database files

Seagate Crystal Reports can access many of the most common PC database formats directly. In other words, the program has builtin capabilities to directly open database files and tables designed

Data Sources

585

Advantages

Disadvantages

Three layers

in dBASE, FoxPro, Clipper, Btrieve, Paradox, and Microsoft Access, among others. This functionality exists as soon as you install Seagate Crystal Reports. Once it is installed on your system, you can immediately begin creating reports based on these databases simply by selecting the appropriate file.

Accessing the database directly is the fastest route to reading the data. Seagate Crystal Reports only needs to talk to a single data access layer that provides contact with the data. Report results can be obtained quickly in almost any system environment.

In addition, data access is simple. Direct access database files are point-and-click data sources. You need only select the required database files and Seagate Crystal Reports reads all of the stored data.

When you access a database directly from Seagate Crystal Reports, only that database type can be used by the report. You can not switch to a different type of database or table without creating a new report.

For example, if you design a report based on Btrieve data, you can not change the tables accessed by the report to Paradox data. Seagate Crystal Reports communicates with Btrieve data using a Btrieve specific syntax, a syntax that is not compatible with Paradox data.

If you access data through ODBC, on the other hand, the syntax used is always the SQL language regardless of the actual database type. See ODBC data sources, Page 606.

Direct access of database files from Seagate Crystal Reports requires three layers:

1.Seagate Crystal Reports, Page 587,

2.Data Translation, Page 587, and

3.Database, Page 588.

586

Seagate Crystal Reports User’s Guide

Crystal Reports Layer

Data Translation Layer

Database Layer

Seagate Crystal Reports uses the data translation layer to talk to the database and access its data.

Seagate Crystal Reports

Seagate Crystal Reports operates as an interface through which you format, arrange, select, and sort the data stored in database files. It obtains data by communicating with one or more files in the data translation layer that can actually read the database. Since Seagate Crystal Reports can work with many forms of data, it must rely on other files to work directly with the data. Seagate Crystal Reports can then use a native method of communication to talk to the translation files.

Data Translation

Data is translated through a set of DLLs specific to Seagate Crystal Reports. The program uses the DLLs specific to a certain data type to understand how data is organized for that type and to present it correctly when your report is printed, previewed, or exported.

NOTE: Seagate Crystal Reports comes with all data translation files for each of the direct access database types that it supports.

Data Sources

587

Common

database formats

For complete information on all required files, refer to the Runtime File Requirements online Help (RUNTIME.HLP).

Database

The database file consists of one or more tables. Different DBMS applications store database information differently. For example, dBASE stores each database table as a separate file. Access, on the other hand, can store several tables, along with queries, macros, and other database elements, all in a single file.

When Seagate Crystal Reports accesses a database file directly, it automatically retrieves information about all of the tables and fields in that file. You may not use all of the tables or fields, but the program will make them available to you. In other words, when a dBASE file is opened, only one table in the dBASE file is available. However, when an Access file is opened, every table in that file is available, even if you never use them all.

NOTE: Seagate Crystal Reports will also open queries in an Access database through the DAO engine or ODBC and will allow you to report on query fields, just like table fields. See DAO, Page 594,

and Access, Page 612.

Although Seagate Crystal Reports uses the same three-tiered system for obtaining data from all direct access database file formats, each format requires a different set of Dynamic Link Libraries (DLL). However, some formats expand the basic threetiered structure. The following sections cover the system used by Seagate Crystal Reports to access data from some of the most popular database formats.

dBASE, FoxPro, Clipper

The dBASE database format remains one of the most popular database management systems (DBMS) used in business. For that reason, Seagate Crystal Reports has been designed to open dBASE data simply and directly through the xBase engine (inside PDBXBSE.DLL). FoxPro and Clipper are dBASE compatible database formats, and Seagate Crystal Reports uses the same DLL to access files created by any of these three DBMS applications.

588

Seagate Crystal Reports User’s Guide

NOTE: The PDBXBSE.DLL translation layer supports FoxPro files up through version 2.5. See Visual FoxPro, Page 621.

Crystal Reports

Crystal Reports layer

Translation layer

PDBXBSE.DLL

Database layer

dBASE

FoxPro

Clipper

file

file

file

The file PDBXBSE.DLL handles all translation between the Seagate Crystal Reports and the dBASE, FoxPro, or Clipper files. Each database file contains only a single database table, but there is no limit on the number of files that can be accessed by a report.

NOTE: dBASE data can also be accessed through the Borland Database Engine (BDE) using the translation file PDBBDE.DLL. To see how the BDE communicates with database data, see Paradox,

Page 589. The BDE, however, does not support FoxPro or Clipper data.

Paradox

Files created with Paradox (.DB) are made available to other applications through the Borland Database Engine (BDE). The BDE is made up of several files installed by Seagate Crystal Reports in the \IDAPI directory by default.

ILD01.DLL

IDDBAS01.DLL

Data Sources

589

IDR10009.DLL

IDODBC01.DLL

IDASCI01.DLL

IDAPI01.DLL

IDBAT01.DLL

IDQRY01.DLL

The BDE does the actual work with the Paradox data, retrieving the requested tables and fields. Since the BDE works so closely with the actual data, it combines with the Paradox database file to create the database layer in the three layer data access model. Seagate Crystal Reports accesses the BDE through the PDBBDE.DLL translation file.

Crystal Reports

Crystal Reports layer

Translation layer

PDBBDE.DLL

Database layer

Borland Database Engine

The 32-bit version of the BDE uses different files. Otherwise, Seagate Crystal Reports uses 32-bit Paradox files in the same way, accessing them through the P2BBDE.DLL 32-bit translation file.

590

Seagate Crystal Reports User’s Guide

The files that make up the 32-bit version of the BDE are:

BLW32.DLL

IDDR32.DLL

CEEUROPE.BLL

IDODBC32.DLL

CHARSET.BLL

IDPDX32.DLL

EUROPE.BLL

IDQBE32.DLL

IDAPI32.DLL

IDR20009.DLL

IDAPIINST.DLL

IDSQL32.DLL

IDASCI32.DLL

OTHER.BLL

IDBAT32.DLL

USA.BLL

IDDBAS32.DLL

CW3215.DLL

Microsoft Access

Microsoft Access provides several means for opening its database files. Each method has its advantages and disadvantages, and the technique that you should use can depend on how your data is set up. Below are descriptions of two techniques for opening Access data from Seagate Crystal Reports, through the Jet engine and through the DAO engine. The third technique uses Microsoft’s Open Database Connectivity (ODBC) standard, and is described in Access, Page 612.

Data Sources

591

NOTE: You can maintain Access security when opening database files using Seagate Crystal Reports by running SYSDB32.EXE and select the Access SYSTM.MDW file. In this way, the program will look to SYSTM.MDW when opening an Access database and the user will be prompted for the Access password (as required) in Seagate Crystal Reports

NOTE: When you open an Access database using the Jet or DAO engine, opens the entire database and loads information about all tables and queries from the database. To do this, Seagate Crystal Reports must reserve a large section of your computer’s memory, called a buffer, in advance. Computer memory restrictions limit this buffer to 65,536 bytes (64K). On average, this restricts the size of your Access database to about 80 tables (depending on the number of fields in your tables).

JET

The Microsoft Jet Database Engine is the part of the Microsoft Access Database Management System that actually handles your database data. As a user, you usually do not work directly with the Jet engine. It acts as a gateway through which Access data is made available to applications. For this reason, the Jet engine must be used regardless of the overall method used to access your Access data. You will see the Jet engine in other sections that discuss Access data.

Since the Jet engine is so closely tied to Access data, Seagate Crystal Reports considers it a part of the actual database. In the following diagram, the files for the Jet engine appear in the database layer. Seagate Crystal Reports uses three files to translate information to and from the Jet engine:

1.PDBJET.DLL

2.PDIRJET.DLL

3.PDCTJET.DLL

592

Seagate Crystal Reports User’s Guide

Crystal Reports

Crystal Reports layer

Data Translation Layer

PDBJET.DLL PDIRJET.DLL PDCTJET.DLL

Database layer

THE MICROSOFT JET ENGINE

MSAJT200.DLL MSABC110.DLL MSAJT112.DLL

Access MDB

Reading Access data through the Jet engine is the most direct route, and, therefore, the fastest method, for reading the data. However, Jet does not allow you to read Access queries. If you need to open Access queries from Seagate Crystal Reports, you should use the DAO engine (DAO, Page 594) or ODBC (Access, Page 612).

NOTE: If you toggle the Use Indexes check box on using the

Database Tab of the File Options dialog box, Seagate Crystal Reports can pass much of the data retrieval process, including simple selection formulas, down to the Jet engine, improving performance and speed. Search for File Options dialog box in

Seagate Crystal Reports online Help.

NOTE: Seagate Crystal Reports provides all necessary files for reading Access tables through the Jet engine. For complete information on necessary files, refer to the Runtime File Requirements online Help (RUNTIME.HLP).

Data Sources

593

DAO

Microsoft’s new Data Access Object (DAO) Engine provides all of the functionality of the Jet engine but also adds many new data access features. DAO uses Microsoft’s Object Linking and Embedding (OLE) technology (installed with Windows 95 and Windows NT) to provide access to Access data through an objectoriented approach.

In addition to Access database tables, Seagate Crystal Reports can open and use Access queries through DAO. If you are not familiar with Access queries, refer to your Access documentation. See How to open Access queries through DAO, Page 554.

NOTE: Access Parameter queries and cross-tab queries can only be opened through an ODBC connection. See How to open Access

parameter queries, Page 558. Access Action queries are not supported by Seagate Crystal Reports.

NOTE: When opening Access queries in a report, make sure the Views and Stored Procedures options are toggled on using the SQL Tab of the File Options dialog box in Seagate Crystal Reports. This ensures that the queries will be visible when you open the Access database.

The DAO engine greatly broadens the possibilities available to Access database users. Because DAO expands and builds on the basic functionality of the Jet engine, primarily working with the actual Access database data, DAO is also considered part of the database layer. To translate information and data to and from DAO, Seagate Crystal Reports uses the DAO translation files P2BDAO.DLL, P2CTDAO.DLL, and P2IRDAO.DLL. Compare these files to the translation layer for accessing MS Access data directly through the Jet engine. See JET, Page 592.

NOTE: The Jet engine is incorporated into the DAO engine and does not appear as a separate engine in the diagram below.

594

Seagate Crystal Reports User’s Guide

Crystal Reports layer

Translation Layer

Crystal Reports

P2IRDAO.DLL P2CTDAO.DLL P2BDAO.DLL

Database layer

OLE

DAO Engine

DAO2532.TLB MSJINT32.DLL

DAO3032.DLL MSJTER32.DLL

VBAJET32.DLL MJT3032.DLL

VEN2232.OLB VBA232.DLL

MSRD2X32.DLL

ACCESS DATA

NOTE: Seagate Crystal Reports provides all necessary files for reading Access data through the DAO engine. Because the program supports the most recent version of DAO, there is also native support for VSFoxPro (see Visual FoxPro, Page 621). For

complete information on necessary files, refer to the Runtime File Requirements online Help (RUNTIME.HLP).

Secured Microsoft Access Databases

If you will be using secured Access databases, the SystemDB parameter in the Windows Registry database (32-bit systems) or CRW.INI (16-bit systems) must be set to point at the path where the SYSTEM.MDA or SYSTEM.MDW (Access 95) file is located. On Windows 95 and Windows NT systems, the SystemDB parameter is located in the following Registry key:

\\HKEY_LOCAL_MACHINE\Software\Crystal Software\Jet\3.0\Engines\Jet

Seagate Crystal Reports includes two utilities to take care of setting this parameter for you:

1. SYSDB16.EXE (16-bit systems changes CRW.INI)

Data Sources

595

2. SYSDB32.EXE (32-bit systems changes Registry key)

These utilities are installed in the \CRW directory (or directory in which the program resides). Simply run the appropriate utility and point it at the location of the SYSTEM.MDA or SYSTEM.MDW file.

Btrieve

The 16-bit version of Seagate Crystal Reports uses two translation files to communicate with the 16-bit Btrieve engine:

1.PDBBTRV.DLL

2.PDCTBTRV.DLL

These files work with the Btrieve files WBTRVDEF.DLL, WBTRCALL.DLL, SBTRVDEF.DLL, and SEDTCONV.DLL for most data access operations.

Crystal Reports

Crystal Reports layer

Translation layer

PDBBTRV.DLL PDCTBTRV.DLL

Database layer

Btrieve Engine

WBTRCALL.DLL

WBTRVDEF.DLL

SEDTCONV.DLL

SBTRVDEF.DLL

Btrieve Data

The rest of the Btrieve engine is a complex collection of DLLs and EXEs that are specific to the version of Btrieve you are using. For complete information on different 16-bit Btrieve engine files,

596

Seagate Crystal Reports User’s Guide

search for Btrieve in Seagate Crystal Reports online Help, and refer to your Btrieve documentation.

NOTE: Btrieve must be configured correctly for Seagate Crystal Reports to read Btrieve databases. If Btrieve is already configured correctly on your system, Seagate Crystal Reports can use your Btrieve data upon installation. Seagate Crystal Reports installs the Btrieve files that it requires to read Btrieve data, but you should refer to your Btrieve documentation to make sure the Btrieve engine is configured correctly.

The 32-bit version of Seagate Crystal Reports connects to the 32bit Btrieve engine through a similar set of Btrieve translation files:

Crystal Reports

Crystal Reports layer

Translation layer

P2BBTRV.DLL P2CTBTRV.DLL

Database layer

Btrieve Engine

WBTRCALL.DLL

WBTRVD32.DLL

S2DTCONV.DLL

SBTRVD32.DLL

W32MKRC.DLL

WBTRV32.DLL

W32MKDE.DLL

Btrieve Data

The primary difference between 32-bit Btrieve and 16-bit Btrieve is the Btrieve engine itself. For complete information on the Btrieve engine, refer to your Btrieve documentation.

NOTE: When you open a Btrieve database, Seagate Crystal Reports opens the entire database and loads information about all

Data Sources

597

tables from the database. To do this, Seagate Crystal Reports must reserve a large section of your computer’s memory, called a buffer, in advance. Computer memory restrictions limit this buffer to 65,536 bytes (64K). On average, this restricts the size of your Btrieve database to about 80 tables, depending on the number of fields in each table.

Btrieve DDF files

Seagate Crystal Reports does not determine the definitions of Btrieve data files directly from the data files themselves. It needs a set of Btrieve Data Dictionary Files (.DDF) that contain file, field, and index information. Seagate Crystal Reports uses WBTRVDEF.DLL and SBTRVDEF.DLL to parse these DDF files. The following are the required DDFs which must all reside in the same directory:

FILE.DDF

FIELD.DDF

INDEX.DDF

A set of DDFs normally contain definitions for multiple Btrieve data files. Once any of the DDFs is selected when creating a new report, Seagate Crystal Reports immediately adds all the data files defined in the DDFs into the report. Seagate Crystal Reports also takes the path defined in the DDFs as the default path of the data files. The DDFs and data files can reside in different locations.

NOTE: Be sure to study your Btrieve documentation for more information on Btrieve DDFs and configuring the Btrieve engine.

Exchange

Exchange is Microsoft’s successor to MS Mail. Exchange, however, includes not only e-mail, but also management of group scheduling, electronic forms, groupware, and Internet connectivity. An Exchange folder can contain standard notes (mail), files, and instances of Exchange forms. All of this data is stored in the Exchange Information Store.

Seagate Crystal Reports can report on data contained in the Exchange Information Store. Exchange data sources available for reporting include:

598

Seagate Crystal Reports User’s Guide

Message Tracking Logs (32-bit only)

Address Lists

¾Personal Address Books

¾Global Address Lists

¾Distribution Lists

Exchange Folder Contents

¾mail messages

¾Exchange Form applications

¾properties of OLE documents

Exchange Administrator (32-bit only)

¾properties of Exchange mailboxes on the Exchange Server

¾properties of public folders on the Exchange Server

¾replica list of public folders

¾ACL (Access Control List) of public folders

Each Exchange data source can be used like a database table and can be linked to other data sources. For example, the Message Tracking Log may be joined to an Address List by using an e-mail address as the link field.

Data Sources

599

Crystal Reports

Crystal Reports layer

Translation layer

Exchange Data Translation

P2STRACK.DLL P2MAPI.DLL

P2SREPL.DLL P2SEXR.DLL

P2MACL.DLL

Database layer

MAPI

Exchange Data Source

The data translation file used to access the Exchange data source depends on what data source is being accessed. The following table lists each of the Exchange data translation files and describes their purpose:

File name

Data source

 

 

 

 

P2STRACK.DLL

Message Tracking Logs (32-bit only)

 

 

P2SMAPI.DLL /

Exchange Folder Contents and

PDSMAPI.DLL

Address Lists

P2SEXR.DLL

Properties of Exchange Mailboxes and

 

Public Folders (32-bit only)

 

 

P2SREPL.DLL

Replica Lists of Public Folders

 

(32-bit only)

P2SACL.DLL

Access Control Lists (ACL) of Public

 

Folders (32-bit only)

 

 

NOTE: PDSMAPI.DLL works with 16-bit Seagate Crystal Reports while P2SMAPI.DLL works with 32-bit Seagate Crystal Reports. Also, PDSMAPI.DLL is the only Exchange driver available for 16bit Seagate Crystal Reports.

600

Seagate Crystal Reports User’s Guide

Exchange translation files work directly with the Microsoft Messaging API (MAPI). MAPI acts as a database engine for Exchange data.

ACT!

Symantec’s ACT! contact management software stores information in a relational database format similar to the xBase format. See dBASE, FoxPro, Clipper, Page 588. Seagate Crystal Reports can read this data and let you produce reports based on your contact information.

Crystal Reports

Crystal Reports layer

Translation layer

CRW.ACT

PDBACT.DLL PDIRACT.DLL

Database layer

ACT! Database

You open ACT! data by selecting the CRW.ACT file from Seagate Crystal Reports when you create a new report. CRW.ACT must be installed in the same directory as the program. This file forces Seagate Crystal Reports to load the PDBACT.DLL and PDCTACT.DLL translation files. This step is important, because ACT! data looks like xBase data to Seagate Crystal Reports, so it will use the PDBXBSE.DLL translation file unless instructed otherwise. If this happens, the data will be translated as xBase data rather than ACT! data, and may not appear correctly in your report. See How to use an ACT! database, Page 579.

Data Sources

601

Oracle 7

This version of Seagate Crystal Reports supports direct access of Oracle 7 SQL databases. This accessibility is provided by the PDSORA7.DLL translation file (installed with the program). This file can communicate directly with the Oracle 7 database driver ORA72WIN.DLL, which works directly with Oracle databases and clients, retrieving the data you need for your report.

NOTE: The Oracle client software must be installed on your system, and the location of the ORA72WIN.DLL file must be in the PATH statement of your AUTOEXEC.BAT file.

Crystal Reports

Crystal Reports layer

Translation layer

PDSORA7.DLL

Database layer

ORA72WIN.DLL and Oracle client

Oracle Data

Microsoft SQL Server 6.x

Databases created by Microsoft’s SQL Server, versions 6.0 and 6.5, can be read directly from Seagate Crystal Reports. The PDSSQL.DLL file installed with the program translates requests to the SQL server and returns data from the SQL server. It communicates directly with the Microsoft SQL Server driver MSDBLIB.DLL.

602

Seagate Crystal Reports User’s Guide

Crystal Reports

Crystal Reports layer

Translation layer

PDSSQL.DLL

Database layer

MSDBLIB.DLL (SQL Server driver)

SQL Database

NOTE: Network administrators and IS managers who run Microsoft’s Systems Management Server for BackOffice can run reports off of Systems Management Server data. Systems Management Server uses SQL Server to store system data, so the files used to access that data are the same files shown here for SQL Server.

Sybase System 10/11

Seagate Crystal Reports opens SQL data created by Sybase System 10 or System 11 directly through the PDSSYB10.DLL, installed with Seagate Crystal Reports. This translation file works with the Sybase database drivers WCTLIB.DLL and WCSLIB.DLL to read Sybase System 10/11 data. If your Sybase server is correctly configured, you will be able to read Sybase data as soon as Seagate Crystal Reports is installed.

NOTE: The 32-bit Sybase drivers are LIBCT.DLL and LIBCS.DLL.

Data Sources

603

Crystal Reports

Crystal Reports layer

Data Translation Layer

PDSSYB10.DLL

Database layer

WCTLIB.DLL

WCSUB.DLL

Sybase Database

Arbor Essbase

Essbase is a highly powerful database format designed on the OLAP (On-Line Analytical Processing) model. OLAP presents data in dimensions, rather than tables. Users can look at relationships between data on an as-needed basis, drilling-down on dimensions to find exactly the data they need in a matter of seconds.

Seagate Crystal Reports opens Essbase data directly through the P2OESBSE.DLL translation file. This file works with the complex engine that drives Essbase. The power of OLAP is combined with the power of Seagate Crystal Reports to produce the most informative and comprehensive reports.

604

Seagate Crystal Reports User’s Guide

Crystal Reports

Crystal Reports layer

Translation layer

P20ESBSE.DLL

Database layer

Essbase drivers

ESSAPIN.DLL ESSOTLN.DLL

ESSBASE.MDB ESSOTLS.MDB

ESSNET.DLL ESSSHR.DLL

SH22W32.DLL

Essbase Data

NOTE: Essbase data can only be accessed from the 32-bit version of Seagate Crystal Reports.

NT Event Log

If using Windows NT version 3.51 or later, you can use Seagate Crystal Reports to report on the NT Event Log. The Event Log is a database used by network administrators to record and keep track of different types of events that can occur on a Windows NT Workstation or a Windows NT server.

Seagate Crystal Reports provides the translation file P2SEVT.DLL for working with NT Event Log data. This file communicates with the Event Logging API in ADVAPI32.DLL, a part of the Windows NT operating system.

Data Sources

605

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]