Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

10.22 Changing PC-Style Databases

Changing PC-Style Databases

PC-style databases are unique from database servers like SQL Server because they reference a physical file. This file can be located on your hard drive or on a shared network drive. The physical location of the database file can cause you problems when you distribute the file because everyone might not have their database located in the same location. The Set Datasource Location dialog box gives you a few options for working with the file path of a PC-style database.

In the top portion of the dialog box, find the database name and right below it click on the Properties node. Find the Database Name property and right-click on it to get the pop-up menu shown in Figure 10-16.



Figure 10-16. Modifying PC-style database properties.

There are three options for setting the database location:

Edit: lets you manually type in the physical file path location of the file. You have to make sure that everyone who gets a copy of this report has the database file at the exact same file path.

Same As Report:, tells Crystal Reports to look for the database in the exact same folder that the report is located in. This means that you don’t have to worry about where the database file is located on the user’s computer as long as the report is in the same folder.

Convert to UNC:, is used when the database file is located on a shared drive on the network. Although most users have similar drive letters for shared network drives, this usually isn’t enforced throughout most companies. Thus, users can use different drive letters to connect to the same shared drive on the network. Using the Convert to UNC option converts the file path to the Universal Naming Convention for files on the network. It does this by using the server name and the share name that the network administrator created. How the user maps their drive letters becomes irrelevant because the file always points to the same location on the network.

By using one of these three options with PC-style databases, you can ensure that the file path maps to the correct location.