Setting Database Options

Crystal Reports .NET has a number of options that are specific to working with datasources and can be set once for the design environment. To see these settings, open any report, right-click, and select Designer ^ Default Settings ^ Database, which will open the dialog shown in Figure 7-2.

Figure 7-2

You can select the database objects you wish to show when creating a Crystal Report, including:



System Tables


Stored Procedures

This is where most developers get tripped up when working with stored procedures. They won't appear as an available datasource when you connect to your server until you turn the Show... Stored Procedure setting on.

You can also set a filter for database objects, using the Table name LIKE and Owner LIKE textboxes. Use the (%) symbol for multiple characters and the underscore ( _ ) to indicate a single character. If you were looking for all objects owned by user DMCAMIS, the Owner LIKE text would be DMCAMIS%.

With the options in the middle of the dialog, select whether to list the tables and fields by their Name, Description, or Both, and use the checkboxes beside these options to sort table and field names alphabetically.

Finally, in the bottom of the dialog, under Advanced Options, select from the following:

□ Use Indexes or Server for Speed—Use existing database indexes or the database server itself for processing where a performance improvement could be gained.

□ Perform Grouping on Server—If you have created a summary report with none of the details showing and no drill-down capabilities, you can push the grouping of that report back to the server. This improves performance because Crystal Reports .NET doesn't have to get all the records and do the grouping itself. A GROUP BY clause will be inserted into the SQL that Crystal Reports generated.

□ Database Server is Case-Insensitive—By default, Crystal Reports .NET is case sensitive, meaning {Customer.Country} = "ca" and {Customer.Country} = "CA" would return different datasets. This setting eliminates that case sensitivity for SQL databases.

□ Select Distinct Data for Browsing—When browsing for data from pull-down or browse dialogs, this ensures that only a distinct recordset (no duplicates) is returned.

Because some of these changes relate directly to the database you are working with, you may need to log off and log back on for them to take effect.

Was this article helpful?

0 0

Post a comment