Operation Manual
Subreports
Using subreports with unlinkable data
24
480 Crystal Reports User’s Guide
While the return value is a valid Social Security Number, the fact that it comes
from a formula prevents you from using the field to link to a Social Security
Number field in another table. You can report on and coordinate the values in
the two tables, however, by using a subreport.
u
To link to/from a formula field
1. Create the primary report using a table that includes the Social Security
Number field.
2. Create (or import) a subreport using the formula that extracts the Social
Security Number from the Employee ID field (for this example,
{@EXTRACT}).
See “Inserting subreports” on page 473.
3. Place the subreport where you want it to appear in the primary report.
4. Link the subreport to the primary report by linking the Social Security
Number field in the primary report ({file.SSN}) to the formula that extracts
the number in the subreport ({@EXTRACT}). See “Linking a subreport to
the main report without modifying the selection formula” on page 477.
Linking unindexed tables
When using PC (not SQL or ODBC) databases, the link field in the lookup
database needs to be indexed in order to create a valid link. You cannot link
the tables in a single report when two tables contain related data yet neither is
indexed on the field which you want to use as a link field, or when the primary
table is indexed but the lookup table is not. You must use subreports if you
want to coordinate the data in both tables.
Note: It is important to note that linking unindexed tables or linking from an
indexed primary table to an unindexed lookup table may cause inefficient
reporting. If your data set is large, this kind of report will take considerable
time to run. Use this technique only if you do not have other options.
u
To link unindexed tables
1. Create the primary report.
2. Create (or import) the subreport and insert it into the primary report.
See “Inserting subreports” on page 473.
3. Use the unindexed fields (or the indexed field in the primary table and the
unindexed field in the lookup table) to link the subreport to the primary
report. See “Linking a subreport to the data in the primary report” on
page 475.