The design of your reports may affect the performance of
your application. With Crystal Reports 9 and higher, you can view potential performance bottlenecks
by opening the Performance Information tool in the report designer window. See the section entitled
"Designing Optimized Web Reports" in the Crystal Reports
Online Help for a detailed overview on how to create efficient reports. By following the
design recommendations in this section you can considerably improve the performance of your
application.
Create reports with saved data
A report that contains saved data does not need to
access the database, unless the saved data is invalidated and discarded.
Saved data is regenerated when the report is
refreshed, a parameter value is changed, or a new field is added to or referenced in the report.
Removing the last field of a table from a report will also discard the saved data so that the table
linking can be re-optimized. However, modifying the report definition, or the look and feel of the
report, does not cause data to be refreshed.
Note: As of version 12, certain
parameters can be modified without causing a refresh of data. For more information see the
IDataDefinition.setSavedDataFilter method.
Reduce the number of records
Performance is greatly affected by the number of
records that the report needs to process. Although RAS can handle very large data sets, filters and
sorts that are applied to this data set can take a comparatively long time to process depending on
how your report is constructed.
For example, consider a situation where a report
with saved data contains 400,000 records and the user always adds a filter that retrieves only 1000
records. Such a report would slow down performance. In this case, it is more efficient to create a
report that fetches the 1000 records from the server, by using a well constructed SQL statement
that includes records that are based on the value in an indexed field.
A report with hundreds of thousands of records is
larger in memory and slows down operations, such as sorting and filtering. The slowdown may not be
noticeable to the person viewing the report, because the first page of the report will be displayed
as soon as it has completed processing. The formatting and processing of the rest of the report
continues in the background.
The default number of records that can be accessed
by a report is 2,000. This number can be modified through the Central Configuration Manager.
Do not include the total page count
If you include the special fields such as "Page N of
M" or "Total Page Count" in your report, the report must complete processing before it can
calculate this value. Avoid using these special fields in your report, unless your report is small,
or you absolutely require the value.
Cache the report templates
If you plan to apply the same template to multiple
reports, it is best to open the report to be used as the template once and cache it, since the
template only needs to be read-only.
Database drivers
Because the major ODBC drivers are multi threaded,
they scale well. See Crystal Reports Online Help for
further information on how to scale your ODBC drivers and ensure that they are threadsafe.
Maps
Map rendering is a single threaded operation that
does not scale well. Although maps are supported, you must be careful to consider the overall
effect a map in your report will have on performance.