User`s guide
For a complete description of how table indexing works, see Indexed tables.
6.4.3 Improving table-linking choices
When you add multiple database tables to your report, you link the tables on a common field so that
records from one table match related records from another. (Table linking works best if your database
tables are indexed.) Linking your database tables in this way is usually much faster than incorporating
linked subreports into your main report.
When you link two or more tables, you want your report to read as few records as possible, while at
the same time finding all matching records. The best ways to adhere to this guideline are to assess
your reporting needs and to plan your strategy before creating your report. When you know exactly
what you need from your data source, Crystal Reports makes it easy to get that information.
There are many other specific issues to consider when linking tables. These additional considerations,
however, are largely contingent upon your reporting environment. In other words, the steps to optimal
table-linking performance depend upon your database type, the possibility of indexing tables, and the
join type required between tables. You'll find complete descriptions for various reporting scenarios in
the section entitled Linking tables.
In the majority of reporting scenarios, the following general procedures should ensure that your tables
are linked for improved if not optimal performance.
6.4.3.1 To link tables effectively
1.
Ensure that each database table is indexed on the field you are going to use.
2.
Add the database tables to your report, and then link from the primary table to the lookup table on
a common field. (Do this instead of inserting a linked subreport and binding it to the data in your
primary report.)
3.
Use a record selection formula that sets range limits on the indexed field in the primary table. This
minimizes the number of records in the primary table for which Crystal Reports must find matching
records in the lookup table.
6.4.4 Using thread-safe database drivers
If you share and refresh reports over the web, open them using thread-safe database drivers whenever
possible. The Crystal Report Engine supports multiple threads. Thus, when you make multiple data
2012-03-14117
Designing Optimized Web Reports