Selecting New Queries in Existing Reports


Concept


Steps:

  1. Begin by opening an existing report using the Open button.

     

    Click the Open button.

    Step 1
  2. Use the Open dialog box to browse and select a report from the list.

    Step 2
  3. In this example, you open the CUSTOMER_INFORMATION report.

     

    Click the CUSTOMER_INFORMATION.rpt list item.

    Step 3
  4. Click the Open button.

    Step 4
  5. Use the Preview window to preview the results of reports.

    Step 5
  6. Click the Design tab.

    Step 6
  7. Use the Design window to create professional looking reports.

    Step 7
  8. In this example, you access the Set Datasource Location dialog box using the Database, Set Datasource Location menu.

     

    Click the Database menu.

    Step 8
  9. Use the Set Datasource Location option to change the location of a database that is active in a report. This function provides a simple way to indicate the new name or location of database files.

    Step 9
  10. Click the Set Datasource location list item.

    Step 10
  11. Use the Set Datasource Location dialog box to replace the current query with another data source or query.

    Step 11
  12. Use the Current Data Source list to view the database and tables currently used in the report. The main report is shown as the root node.

    Step 12
  13. Click the TRAINING list item.

    Step 13
  14. Use the Replace with field to browse for the data source you want to add to your report.

    Step 14
  15. Double-click the History list item.

    Step 15
  16. Double-click the QUERY list item.

    Step 16
  17. Press the left mouse button and drag the mouse to select the desired text.

    Step 17
  18. Release the mouse button.

    Step 18
  19. Click the CUSTOMER_UNITS list item.

    Step 19
  20. Use the Update button to update the new data source information in the Current Data Source list.

     

    If the new data source is different from the one you're replacing, the Map Fields dialog box appears.

    Step 20
  21. Note that you must select queries in both Current Data Source and Replace With fields to activate the Update button.

     

    Click the Update button.

    Step 21
  22. Click the Close button.

    Step 22
  23. In this example, you access the Verify Database dialog box using the Database, Verify Database menu.

     

    Click the Database menu.

    Step 23
  24. Use the Verify Database option to make certain your report prints with the current version of the active database and resets its record buffers to the current record size.

    Step 24
  25. Click the Verify Database list item.

    Step 25
  26. Click the OK button.

    Step 26
  27. Use the Map Fields dialog box to associate the existing report fields with the appropriate new query fields.

     

    The Map Fields process ensures that the reports display the desired field values from the new query or data source.

    Step 27
  28. The Map Fields dialog box appears when you:

    •  Change any data structures in the existing query.

    •  Replace the existing query with another query or data source.

     

    When you replace the query that the report uses as the data source, the application detects differences between the fields in the original query and the fields in the new query.

    Step 28
  29. In this example, you dismiss the Map Fields dialog box.

     

    Click the OK button.

    Step 29
  30. In this example, you dismiss the database message.

     

    Click the OK button.

    Step 30
  31. Use the Field Explorer button to open the Field Explorer for you to insert database fields.

     

    Alternatively, select View, Field Explorer on the menu bar.

    Step 31
  32. In this example, you open the Field Explorer using the Field Explorer button.

     

    Click the Field Explorer button.

    Step 32
  33. Use the Field Explorer to insert, modify, or delete fields on the Design and Preview windows of Crystal Reports.

    Step 33
  34. Use the Database Fields branch of the tree to add database fields to your report.

     

    Fields are listed by table.

    Step 34
  35. Double-click the Database Fields list item.

    Step 35
  36. Double-click the TRAINING list item.

    Step 36
  37. Note that some of the original fields from the report were removed because the new query does not use those fields. Some of the fields from the query are in the report because the fields exist in the new query.

    Step 37
  38. In this example, you select and drag the DESCRSHORT field in to the Details section of the report.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 38
  39. Release the mouse button.

    Step 39
  40. In this example, you select and drag the TRAINING_UNITS field in to the Details section of the report.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 40
  41. Step 41

  42. In this example, you delete the Group Header #1 by right-clicking the group and select the Delete Group option.

     

    Right-click in the Group Header #1 field.

    Step 42
  43. Use the Delete Group option to remove an existing report group.

     

    Click the Delete Group list item.

    Step 43
  44. Use the Save button to save reports.

     

    Alternatively, select File, Save on the menu bar.

    Step 44
  45. In this example, you will save the report using the Save button.

     

    Click the Save button.

    Step 45
  46. Click the Preview tab.

    Step 46
  47. Use the Database Expert button to access the Database Expert dialog box, where you select a data source and tables, and to define links between tables.

     

    Alternatively, select Database, Database Expert on the menu bar.

    Step 47
  48. In this example, you will modify the alias that is defined within the report using the Database Expert button.

     

    Click the Database Expert button.

    Step 48
  49. Use the Database Expert dialog box to change aliases.

    Step 49
  50. Use the Selected Tables list to view the tables you've selected for your report.

    Step 50
  51. Click the TRAINING list item.

    Step 51
  52. In this case, press the <F2> key to activate the TRAINING field.

     

    Press [F2].

    Step 52
  53. Enter the desired information into the TRAINING field. Enter

     "CUSTOMER_UNIT"
    .

    Step 53
  54. Click the OK button.

    Step 54
  55. Click the Save button.

    Step 55

You have successfully selected a new query in an existing report and updated the alias.

Table of Contents  Start Topic