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
- Perform one of the following steps:
- To use Microsoft Visual Studio with the Crystal Reports application:
- 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.
- Select File » New » Project from the main menu.
A new Windows Application project opens.
- Select the Visual C# » Window project type from the project types list.
- Select Crystal Reports Application from the templates list.
- Enter the Name.
- Enter the Location.
- Check Create directory for solution.
- Click OK.
This step creates a Crystal Reports project and opens the Visual Studio 2005 Form Design Screen, displaying the Crystal Reports Gallery form.
- Select As a Blank Report from the Crystal Reports Gallery form.
- Click OK.
- Either double-click the Microsoft Visual Studio icon on the desktop, or select Start » All Programs » Microsoft Visual Studio 2005 » Microsoft Visual Studio 2005.
- To use the Crystal Reports application:
- If the Welcome to Crystal Reports form is not opened, select File » New from the menu.
- Select the option to Create a New Crystal Report Document - As a Blank Report.
- 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.
- To use Microsoft Visual Studio with the Crystal Reports application:
- 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.
- Expand the Create New Connection node.
- Expand the OLE DB (ADO) node.
This step opens the OLE DB (ADO) form.
- Select the Provider to be SQL Native Client.
- Click Next.
- Enter the name of the Data Source from where the data for the report is to come.
- Enter a valid User ID for the database server.
- Enter the Password for the user.
- Enter the name of the Database.
- Uncheck Integrated Security.
- 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.
- Expand the node for the database.
- Expand the dbo node.
- Expand the Tables node.
All MineMarket database tables display under the Tables node.
- Locate and select the required table in the Available Data Sources field group.
- Click > to move it to the Selected Tables field group.
- Add other tables as required for the report.
- Click OK.
When more than one table is added to the report template, the Links tab displays.
- Select the Links tab.
- Expand the form if all tables are not visible, and ensure that no tables are hiding behind other tables.
- Enter the links to relate the tables to each other.
- Click Auto-Arrange to rearrange the tables and links in a logical order.
- Click OK.
This step closes the Database Expert form and returns control to the Report Template form.
- Expand the Database Fields node in the Field Explorer field group.
- Build the report by dragging fields onto the Report Template form.
- Click Save.
Note: Save the report template to the Report Template folder, ensuring that the name is unique.
- Exit the Crystal Reports application.
- If using the Microsoft Visual Studio application, exit it.