The Structure of the Repository

book list add book to my bookshelf create a bookmark purchase this book online

mastering crystal reports 9
Chapter 5 - Working with the Crystal Repository
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

When Crystal Reports 9 is installed, a sample Microsoft Access database named Repository.mdb is installed in a directory accessible to all program files. This database is ready to go and does not need anything done to it before being used. The directory path for Crystal Reports is shown in Figure 5.13, while the directory path for the repository is shown in Figure 5.14.

Tip 

If you plan on customizing the Repository database, make a copy of the .mdb file so that you always have an original version to go back to without needing to re-install Crystal Reports.


Figure 5.13. Crystal Reports installation directory


Figure 5.14. Repository installation directory

Repository Database Tables

Although it is not necessary to ever open the repository through Microsoft Access, if you plan to replace the sample repository with your own repository database, you’ll need to be familiar with its structure.

If you open and view the Crystal Repository through Microsoft Access, you will see that it contains six tables: or_objectdetails_30, or_objectdetails_31, or_objectdetails_32, or_objectdetails_33, or_objects, and or_type_schema. The tables, the column names, and the column attributes are shown in Figure 5.15, Figure 5.16, Figure 5.17, Figure 5.18, Figure 5.19, and Figure 5.20. The first four table names are strikingly similar; they store object repository detail information for each of the four types of objects allowed in the repository.


Figure 5.15. or_objectdetails_30 table


Figure 5.16. or_objectdetails_31 table


Figure 5.17. or_objectdetails_32 table


Figure 5.18. or_objectdetails_33 table


Figure 5.19. or_objects table


Figure 5.20. or_type_schema table

start sidebar
Security Permissions

Crystal Reports does not provide security for the repository database. This should not be a surprise; Crystal doesn’t supply the security for any of the databases it connects to during the reporting process. Nor should it have to. Security is one of the more powerful features provided by a database management system, so it makes sense to rely on the database to enforce data security.

Database-level security generally involves granting privileges to users or groups to specific tables in a database or to a database as a whole. In order for the user to be able to add, delete, or modify objects in the repository, the permissions on the database have to be set appropriately. As an example, if a report designer does not have Delete privileges on a repository table, the report designer will not be allowed to delete objects from the repository.

The Microsoft Access Repository database shipped with Crystal Reports does not have any initial security applied to it. If you have Microsoft Access, you can add security to the default Repository.mdb; however, all reports that reference the linked repository would then require a user id and password in order to be refreshed.

end sidebar

Creating and Linking a Repository

The Microsoft Access Repository database installed during the Crystal Reports installation process is accessible to and used by Crystal automatically. You can, however, store the database in a different location or create a completely different database using another type of database software. Here are the steps required to integrate a new repository with Crystal Reports:

  1. Create a blank database using the table names and design covered earlier in the section “Repository Database Tables.”

  2. Configure an ODBC System data source name (DSN) connection to the new database. System data sources are accessible to all users on a computer while user data sources are available only to the user who created the data source.

  3. Update the ODBC data source name in the ORMAP.INI file.

By default, the repository database is installed on the local machine with Crystal Reports. You may want to move the repository to a shared network drive so that multiple report designers can access it simultaneously in a shared way. To change the location of the repository, use the ODBC Manager to update the data source’s location information. Figure 5.21 shows the ODBC Microsoft Access Setup dialog that is used to specify the data source and give it a data source name. The exact steps to access the ODBC data source setup area vary by operating system; for Windows 2000, you can use Start > Control Panel > Administrative > Data Sources (ODBC), switch to the System DSN tab, and either add or configure the data source from this point.

click to expand
Figure 5.21. ODBC data source setup

The data source name from the ODBC setup is used in the object repository initialization file, ORMAP.INI. This file is located in the same directory as the repository (see Figure 5.14). INI files are ASCII text files that can be modified with any word processing tool. Figure 5.22 shows the ORMAP.INI file opened using Notepad. The last line of the file is the one that needs to be updated if you change the ODBC data source. On the left of the equal sign, the phrase Crystal Repository needs to be left as is. On the right side of the equal sign, the phrase Crystal Repository represents the sample Microsoft Access database’s data source name. To update the location or name of the repository, replace the text on the right side of the equal sign with the ODBC data source name used in the ODBC Microsoft Access Setup dialog (see Figure 5.21).

click to expand
Figure 5.22. ORMAP.INI   

Note 

There can be only one repository associated with the phrase Crystal Repository; creating a different database replaces the one that was installed with Crystal Reports.

Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement
 
Conello © 2000-2003     Feedback


Mastering Crystal Reports 9
Mastering Crystal Reports 9
ISBN: 0782141730
EAN: 2147483647
Year: 2005
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net