Running a Crystal Report

Introduction

Run Crystal Report is a Format tool used to import a pre-designed Crystal Report. It outputs the report in one of a range of formats which can be consumed byother tools in TaskCentre.

The report can be run in one of two ways:

  • The ‘Run Crystal Report’ step can be used standalone and without the need for a preceding query step. An already completed report is imported in to the tool, this way TaskCentre can be used to automatically run a single existing report that until now has had to be run manually.Overviw Pic(1)
  • Alternatively, multiple reports can automatically be generated by using a TaskCentre database query to filter specific results required for the report, one report produced for each row returned by the query recordset.
    Overview 2(1)

Example: A TaskCentre query is setup to locate accounts in a database which have exceeded their credit limit. By using parameters the account number will be directly mapped to a parameter field within the Crystal Report.

Crystal Reports will use the account number to complete a database query of it’s own which will obtain more information on the account to complete the report. The number of accounts located by the TaskCentre query will dictate the number of reports generated.

The Crystal Report generated by the step can automatically be delivered via email, saved to a location or published to form part of Web or Intranet content.

Configuring Run Crystal Report

In order for Crystal Reports to be run the software prerequisites have first got to be met. The user must have installed the runtime components using the TaskCentre Configurator.

Please see Installing and configuring the server

For multiple reports TaskCentre and the Crystal Reports designer must be using the same data source.

Using the Tool

The Run Crystal Report tool is dragged from the task browser under Format tools and into the task planner. This will automatically open the tool for configuration.

General Tab

Within the General tab you provide an appropriate name and description for the step.

If you want to generate multiple reports from a TaskCentre query then a recordset will need to be selected. Each time the task processes a row from the query the data inserted into the parameters of the report will dynamically change, therefore producing a new report each time.

Tick the box Use a Recordset and use the drop down list to select a step that outputs a recordset.

Alternatively, the tick box can be left blank if you plan on using a data source from within the report builder to populate the parameters.

1(2)

Report Tab – Importing the report

The Report tab allows a Crystal Report to be run into the tool by using the Import button. Parameters are set to map data to the report if required.

If you are using an existing report which is ready to be run, then once imported in to the tool no further action needs to be taken and the step can be closed by clicking OK. The report can now be automatically run based on a pre-defined schedule.

Below will provide a section overview of the Report tab.

Information Pane

Crystal report 8(1)

This section displays what report is loaded.

Import – Opens a file browser allowing you to search for the Crystal Report that is to be imported.

Edit Report – used to edit the currently loaded Crystal Report.

Export – This button is used to re-save the currently loaded Crystal Report under another name or to a different location.

Mapped Report Parameters

Crystal report 3(1)

This section is the link between the TaskCentre query and the Crystal Report. It is used to map data from the query recordset to fields in the Crystal Report by means of parameters. Active parameters are displayed in this box.They can be added, amended and removed.Initially this section is blank until a parameter mapping is created.

Database Tables Logon Information

Crystal report 4(2)

This section lists all the tables within the database being used by the report. It also lists the security details (Username & Password) for each database if security features are in use for access.

If the report is using a database which requires authentication for access then a password will need to be entered by double clicking on the database table. This will prompt for a box where login details can be entered. This allows the task to automatically login to the database. If no credentials are provided the task could potentially fail.

Adding Parameters

The report is populated with data from a query recordset by using parameters. Parameters have to first be setup in the Crystal Report so data can be mapped to them via values. Once done the parameters will be available to select at this stage.

    1. Select Add which will open the following boxCrystal report 5
      Here we can link specific information from the TaskCentre query which will be input into the Crystal Report. This is done by using the task browser and dragging the required data from the RecordSource in to the Value field. The data chosen should relate to what is displayed in the Report Parameter.

      Report Parameter – Used to select which parameter field in the report will be used to map data to. Parameter fields are only available if first created in the Crystal Reports application.

      Discrete Value – Select if only 1 value is to be used for the selected parameter field.

      Range – Select if 2 values are to be used.

    2. In the task browser select the Environment tab. Under Run Crystal Report-> RecordSource, locate the required column to be used and drag and drop in to the Value field.3(1)
    3. Select OK to complete.

This completes configuring a Crystal Report step.

To read about tasks which make use of this tool see:

Building a task that sends a Crystal Report by email