Crystal Reports 10: The Complete Reference

Overview

As you become more sophisticated in your report designing abilities , you will find at times that it s difficult, if not impossible , to create certain kinds of reports . For example, you might want to create one of the following:

In each of these cases, you can t create the report using traditional Crystal Reports methods . The first three instances are prohibitive because a report, by nature, can use only a single result set, or a single group of fields returned all at once, from the database. The fourth instance exhibits a common problem that occurs when multiple tables contain more than one matching record. And the fifth instance (a fairly common situation), exhibits the problem encountered when there are no common fields that can be linked between the two tables.

Crystal Reports provides an innovative way to deal with these types of reporting challenges. Subreports allow you to solve these problems by, in essence, placing one report inside another report. A subreport is simply another report that appears inside the original main report as an object. Even though both reports have separate layouts and separate Design tabs, they appear together in the same place. The main report is created initially, after which one or more subreports are added to the main report.

Each subreport is designed separately, based on its own database tables and fields. You can preview each subreport in its own Preview tab, format individual objects in each subreport, and create unique selection criteria for the subreport. However, when you return to the main report s Preview tab or print the main report, the subreports will be processed and printed at the same time, appearing inside the main report.

There are two main types of subreports:

You can also choose when subreports are processed by the main report. In-place subreports process at the same time as the main report and return their results at the same time. On-demand subreports appear in the Preview tab only with a placeholder and don t process until a viewer double-clicks them. This improves the performance of the main report, because all the subreports don t have to be processed at the same time as the main report.

Категории