Create a Crystal Reports Template with an OLE DB (ADO) Connection

Note: This activity describes using Visual Studio 2005 with the Crystal Reports application; or using the Crystal Reports application. Activity steps may vary with later versions of these applications. This activity does not explain the installation, configuration or in-depth information for Microsoft Visual Studio, Crystal Reports or Microsoft SQL Server. See your network administrator for installation and configuration information.

Activity Steps

  1. Perform one of the following steps:
    1. To use Microsoft Visual Studio with the Crystal Reports application:
      1. Either double-click the Microsoft Visual Studio icon on the desktop, or select Start » All Programs » Microsoft Visual Studio 2005 » Microsoft Visual Studio 2005.

        The Visual Studio .NET 2005 application opens.

      2. Select File » New » Project from the main menu.

        A new Windows Application project opens.

      3. Select the Visual C# » Window project type from the project types list.
      4. Select Crystal Reports Application from the templates list.
      5. Enter the Name.
      6. Enter the Location.
      7. Check Create directory for solution.
      8. Click OK.

        This step creates a Crystal Reports project and opens the Visual Studio 2005 Form Design Screen, displaying the Crystal Reports Gallery form.

      9. Select As a Blank Report from the Crystal Reports Gallery form.
      10. Click OK.
    2. To use the Crystal Reports application:
      1. If the Welcome to Crystal Reports form is not opened, select File » New from the menu.
      2. Select the option to Create a New Crystal Report Document - As a Blank Report.
      3. Click OK.

    This step creates and opens a blank report template, and either opens the blank Crystal Reports template or opens the Data Expert form.

  2. If the Data Expert form is not opened, eight-click Database Fields in the Fields Explorer field group and select Database Expert from the menu.
  3. Expand the Create New Connection node.
  4. Expand the OLE DB (ADO) node.

    This step opens the OLE DB (ADO) form.

  5. Select the Provider to be SQL Native Client.
  6. Click Next.
  7. Enter the name of the Data Source from where the data for the report is to come.
  8. Enter a valid User ID for the database server.
  9. Enter the Password for the user.
  10. Enter the name of the Database.
  11. Uncheck Integrated Security.
  12. Click Finish.

    The server displays as a node under the OLE DB (ADO) node, and the database displays as a node under the server node in the Data tab.

  13. Expand the node for the database.
  14. Expand the dbo node.
  15. Expand the Tables node.

    All MineMarket database tables display under the Tables node.

  16. Locate and select the required table in the Available Data Sources field group.
  17. Click > to move it to the Selected Tables field group.
  18. Add other tables as required for the report.
  19. Click OK.

    When more than one table is added to the report template, the Links tab displays.

  20. Select the Links tab.
  21. Expand the form if all tables are not visible, and ensure that no tables are hiding behind other tables.
  22. Enter the links to relate the tables to each other.
  23. Click Auto-Arrange to rearrange the tables and links in a logical order.
  24. Click OK.

    This step closes the Database Expert form and returns control to the Report Template form.

  25. Expand the Database Fields node in the Field Explorer field group.
  26. Build the report by dragging fields onto the Report Template form.
  27. Click Save.

    Note: Save the report template to the Report Template folder, ensuring that the name is unique.

  28. Exit the Crystal Reports application.
  29. If using the Microsoft Visual Studio application, exit it.