Using the same report with different database files

Date:Archived
Product/Release:Crystal Reports for LANSA
Abstract:It is very easy to use a different file or set of files when running an existing report
Submitted By:LANSA Technical Support

When a report is executed, it will by default look for the file(s) used when the report was designed. The files may have been 'refreshed' with new information from the AS/400, but the file name and directory are by default the same.

However, sometimes it may be desirable to run the same report for a different numbers of files. For example, several queries may have been executed to display the sales information of specific countries or product ranges, each time saving the results of the query to a different PC file name. In this case the file layout of the files is identical (or at least similar) but the file names and locations different.

The same report can be used to list the information in these database files, without having to copy or rename anything. To do this, use the Set Location command from the Database menu:

  1. Select the Set Location command from the Database menu. The following dialog box will pop up.
    Location
     
  2. Press the Set Location button and the Choose-new-Location dialog box will pop up. In this dialog box both the name and location of the file can be changed. In this example Crystal Reports for LANSA is redirected to look for another file name. (slsprdB in stead of slsqtr1). When done, press the OK button.
    Location
     
  3. The Set Location Dialog box will re-appear, this time with the changed physical name (slsprdB) and location of the database file. The logical file name in the report is still the same (slsqtr1). This process can be repeated for other files if required, or press the done button.
    File

When the new file has exactly the same layout as the original file, just run the report. When the layout is not known or when the layout is slightly different (for example some extra fields), then select the Verify Database command from the Database menu. Crystal Reports for LANSA will automatically fix any differences between the old and new file layout.