Adding Objects to and from the Repository

Different object types have different methods required to add the object to or from the repository.

Adding Text Objects and Images

To add text and image objects from the repository, the repository explorer should be open in Crystal Reports. To open the repository explorer, you need to authenticate with Crystal Enterprise. After this occurs, you can see all the folders and objects available in the repository. To add a text or image field, simply drag the field onto the report. You will notice that the object is read-only. To modify the object, right-click the object and select Disconnect from Repository (see Figure 17.2). You will then be able to modify the object. If the changed object is saved back into the repository with the same name, the original version will be replaced and all Crystal Reports that use this object can be updated.

Figure 17.2. To modify the object, the user needs to disconnect the object first.


To modify the object, you need to disconnect the object first. If the changed object is saved back into the repository with the same name, all objects that use this object can be updated.

To reconnect a text object or image to the repository, simply drag and drop the object from the Design or Preview tab on Crystal Reports back to its original repository object name in the Repository Explorer. A dialog will appear to confirm that you want to update the original object or add a new one. The user can then set the properties of the object by adding the required information.

For information on how to set the security around the object explorer, p. 364


The capability to store objects from Crystal Analysis reports in the repository was not supported at publication time.


SQL Commands

With the introduction of SQL Command objects to Crystal Reports, developers have been able to write custom database SQL to access data. The repository enables the developers to share these objects with others who might not have that skill set or those developers who do not want to reinvent the wheel.

To select a SQL Command from the repository, select the Repository from the Data Explorer or the Data step of the Report Wizard. Once again, Crystal Enterprise will ask you to authenticate to ensure you are a valid user. Select the required SQL Command from the repository (see Figure 17.3). If the command has any parameters associated with it you will be required to populate the parameters. This enables the SQL statement to run and populate the report with data, to give the report designer some data to work with.

Figure 17.3. The command objects as displayed by the Data step of the Report Wizard.



If you hover your mouse pointer over the SQL Command, it will display the SQL statement, enabling you to review the statement before selection.

To add a new SQL Command object to the repository, use the Data Connection, and then connect to the database desired in the Available Data Sources list box and choose Add Command from the list of available options. Select Add Command by double-clicking on it. This opens the Add Command to Report dialog. Then follow these steps:

  1. Enter the SQL statement you want into the query box. If parameters are required, you can use this dialog to create them as well.
  2. Before leaving this dialog, right-click the newly created SQL objects.


For more in-depth information on Structured Query Language, see the supplemental material at the end of this book.


Custom Functions

Custom functions are reusable procedures that enable you to share logic across reports (see Figure 17.4). To allow for this sharing, the function needs to be data-and report-independent and specific guidelines must be adhered to:

  • No User Function Libraries (UFL) can be used because these are machine dependent.
  • No report or data source fields.
  • You cannot associate a particular state with the function, such as Evaluation Time or Print State.
  • You cannot use recursion, that is, the function cannot call itself.
  • You cannot use variables, either shared or global, because these are report-specific.

Figure 17.4. A custom function in the repository displayed in the Formula Workshop; the summary shows a brief description of the custom function, return types, and function arguments.



Custom functions are not editable from the Repository Explorer because they are housed inside of Formulas. To view custom functions available in the Repository, go to Report, Formula Workshop. In the group tree, the Crystal Repository branch can be seen and all custom functions can be viewed from there.

Adding a new custom function to the repository needs to be done from within the Crystal Reports designer. The user can select the drop-down list from the new icon in the Formula Workshop. The function is then created and the user can select the Add to Repository icon, which adds the function to the desired location in the repository.

Organizing the Repository

The Repository Explorer represents the repository database as a tree structure made up of folders and objects. It is up to the report designer how he wants to organize it. For example, the sample Crystal Repository that ships with Crystal Enterprise 10 is sorted by object types. The folders are named to indicate their contents (Images, Text Objects, and Commands). However, the content creator or report designer can use folders to his organizational advantage.

To add new folders to the repository, right-click on the desired folder where the intended subfolder is to be placed. If the folder is intended to be at the root, right-click on the repository name. Choose New Folder from the context menu.

To move objects or folders, drag and drop the object to the desired location. To rename a folder, simply choose the folder to be renamed, right-click on it, and choose Rename from the context menu.

Part I. Crystal Reports Design

Creating and Designing Basic Reports

Selecting and Grouping Data

Filtering, Sorting, and Summarizing Data

Understanding and Implementing Formulas

Implementing Parameters for Dynamic Reporting

Part II. Formatting Crystal Reports

Fundamentals of Report Formatting

Working with Report Sections

Visualizing Your Data with Charts and Maps

Custom Formatting Techniques

Part III. Advanced Crystal Reports Design

Using Cross-Tabs for Summarized Reporting

Using Record Selections and Alerts for Interactive Reporting

Using Subreports and Multi-Pass Reporting

Using Formulas and Custom Functions

Designing Effective Report Templates

Additional Data Sources for Crystal Reports

Multidimensional Reporting Against OLAP Data with Crystal Reports

Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design

Introduction to Crystal Repository

Crystal Reports Semantic Layer Business Views

Creating Crystal Analysis Reports

Advanced Crystal Analysis Report Design

Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting

Part V. Web Report Distribution Using Crystal Enterprise

Introduction to Crystal Enterprise

Using Crystal Enterprise with Web Desktop

Crystal Enterprise Architecture

Planning Considerations When Deploying Crystal Enterprise

Deploying Crystal Enterprise in a Complex Network Environment

Administering and Configuring Crystal Enterprise

Part VI. Customized Report Distribution Using Crystal Reports Components

Java Reporting Components

Crystal Reports .NET Components

COM Reporting Components

Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition

Introduction to Crystal Enterprise Embedded Edition

Crystal Enterprise Viewing Reports

Crystal Enterprise Embedded Report Modification and Creation

Part VIII. Customized Report Distribution Using Crystal Enterprise Professional

Introduction to the Crystal Enterprise Professional Object Model

Creating Enterprise Reports Applications with Crystal Enterprise Part I

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Appendix A. Using Sql Queries In Crystal Reports

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341 © 2008-2020.
If you may any questions please contact us: