Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

How to log off an ODBC data source

Choose the LOG OFF SERVER command from the Database menu. The Log Off Server dialog box appears.

2 Highlight the ODBC data source you want to log off from this list.

3 Then click the Log Off button.

"The ODBC data source is removed from the Logged On Servers list.

# Click Done when finished.

How to change the ODBC data source accessed by a report

Choose the SET LOCATION command from the Database menu. The Set Location dialog box appears with a list of table aliases for the tables in the report displayed. Table location and log on information for the table you highlight will also be displayed below the list of tables. Select the first table in the list and click the Set Location button.

570

Seagate Crystal Reports User’s Guide

2 Highlight the first table in this list.

3 Click the Set Location button.

"Log on to the original ODBC data source if you are not logged on already. You must first log on to the old data source before you can change a report to use a new data source. Since you must be logged on to the old data source, the old data source must be available on the local machine.

If the machine is no longer connected to the old server, you can install an ODBC data source with the name of the old data source and have it point to the new database server. Log on to this data source as the “old” data source.

If you are using the same data source name to connect to a new server, you must configure that data source under ODBC Admin or the ODBC Control Panel, and make it point to the new server.

After logging on to the old data source, you will see the Choose SQL Table dialog box with a list of tables in the SQL Tables list box and the old data source in the SQL Databases list box.

Working With Databases

571

5 Click the Log On Server button to log on to the new data source.

¾You should now be logged on to both the old and the new data sources.

¾The new data source should now appear in the SQL Databases list box of the Choose SQL Table dialog box.

$Click the new data source to display its tables, then select the appropriate table from this list. The table you choose should correspond to the first table you selected in the Set Location dialog box.

%Click OK and you are prompted to change the location of all tables in the report to the location you specified for the first table.

8 Click Yes to set the location of all tables in the report to the same database.

'Close the Set Location dialog box, and choose the VERIFY DATABASE command from the Database menu to refresh the table definitions in the report.

Log off the old data source.

Save the report.

572

Seagate Crystal Reports User’s Guide

How to select a stored procedure from an SQL database and change stored procedure parameters

Choose the OPTIONS command from the File menu. The File Options dialog box appears. Click the SQL Tab to activate it.

2 Make sure either the Stored Procedures or the Prompt on every table check box is toggled on.

The Stored Procedures option automatically displays any available stored procedures when you log on to an SQL database.

The Prompt on every table option displays the Allow Reporting On dialog box every time you log on to an ODBC data source. This dialog box provides the same options as the Allow Reporting On section of the File Options dialog box, but provides those options for every ODBC data source you log on to.

!In addition, you can specify Table name LIKE and Owner LIKE options if you wish.

Working With Databases

573

Table name LIKE is based on the SQL LIKE clause. This option allows you to specify the kinds of table names you want to appear in the Choose SQL Table dialog box. Use the underscore character (_) or the percent sign character (%) as wildcards with this function. The underscore character specifies any single character, while the percent sign signifies any character string. For example, DAV_ matches DAVE only, while DAV% matches DAVE and DAVID. Table name LIKE C% would display only those tables that have a table name beginning with the letter C.

Owner LIKE is also based on the SQL LIKE clause. The Owner LIKE option allows you to select the Owner (or Creator or Alias) of the table, not the table name itself. For example Owner LIKE C% would display only those tables that had an owner beginning with the letter C.

NOTE: For more information on the SQL LIKE clause, refer to your SQL documentation.

" Click OK to exit the File Options dialog box.

#Create a new report based on the SQL database that contains the stored procedure you want to use. When you choose SQL/ ODBC as the source of your data, the Log On Server dialog box appears.

6 Highlight the ODBC data source for your SQL Server from this list, then click OK.

The SQL Server Login dialog box appears.

574

Seagate Crystal Reports User’s Guide

7 Enter required information then click OK when finished to log in.

8 Click the Options button.

The Options section of the SQL Server Login dialog box appears.

9 Verify the settings for your SQL Server.

Click OK. If you toggled the Prompt on every table check box on using the File Options dialog box, the Allow Reporting On dialog box now appears. Otherwise, skip to Step 12.

11 Make sure the Stored Procedures check box is selected, then click OK.

The Choose SQL Table dialog box appears.

Working With Databases

575

12 Highlight an SQL stored procedure from this list, then click OK.

! The stored procedure is added to your report, and the Stored Procedure Input Parameters dialog box appears.

14 Highlight a parameter from this list box.

15 Assign a value by typing into the Parameter Value text box and click the Update button.

$ The value displayed in the Name list box will be updated.

% Repeat Steps 14 and 15 for each parameter that appears in the

Name/Value list box.

& Click OK when finished. You can change parameter values at any time by choosing the STORED PROCEDURE PARAMETERS command on the Database menu.

576

Seagate Crystal Reports User’s Guide

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]