Example: Creating a Crystal Report from a stored procedure.
Note: this example is using Crystal Reports 8.0.
- Open Crystal Reports Application
- File > New
- Select "As Blank Report" option
- In the Data Explorer expand "More Data Sources" and expand "OLE DB"
- Click the "Options..." button and make sure that Stored Procedures option is checked.
- Under "OLE DB" double click "Make New Connection"
- Select Microsoft OLE DB Provider for SQL Server
- Enter the server name, user name, password, and the
database.
- Test the connection.
- Click OK.
- Expand Stored Procedures and select "CustOrderHist" stored
procedure
- Click Add.
- Enter a customer id (like ANATR) form the Customer
table
- Click OK.
- Close the Data Explorer and Crystal Reports will open
in the design view
- Drag fields from the Field Explorer to the details
section of the report
- Click the refresh button
- Save the report to a local drive
- In the Report Portal got to Design > Crystal Report
- Enter the name of the report (Customer Orders)
- Browse and select the file you saved in the previous
step
- Select a connection (Pubs)
- Click the upload button
- Click the edit button for the "CustomerId"
parameter
- Enter the filter description.
- Select List Type: Table.
- Select Table and select Key column and Name Column
- Click the Test button and test the dropdown list.
- Click the Update button.
- Click the "Go Back" link on the bottom of the
screen.
- Select a item in the dropdown list
- Click the view button to test the report