The following procedure describes how to create a SQL query statement that can be embedded into a Crystal report, running from your client desktop.
Step | Action | Result |
1. | Install SQL View as described in the Installation section and configure the Web Part to make sure it can communicate with the SharePoint content database as described in the Configuration section. | |
2. | Go to the page where SQL View is installed and generate the SQL query statement by completing as shown here: |
|
3. | After clicking the Generate button, check the database to make sure a view was created, using SQL Enterprise Manager as in this example: | |
4. | Create a data source on your desktop that provides the connection to the SharePoint content database where the task list exists. You can do this on a Windows XP desktop by selecting Start > All Programs > Administrative Tools > Data Sources (ODBC). | |
5. | Add a new data source, using the SQL Server driver. | |
6. | Enter the name of the data source and select the appropriate SharePoint server name. | |
7. | Fill in the account logon with the appropriate permission to read the content database. | |
8. | Select the correct table name for the SharePoint content database. | |
9. | Test the data source you just created to make sure that access permission to the table is working correctly. You should now have a new DSN (WSS-RD1 in this example) listed in the ODBC data sources list. | |
10. | Startup Crystal Reports, create a new report and select a new ODBC driver. | |
11. | Expand the ODBC tree, select the DSN that you just created in step 3, supply the correct user information, and then select the SharePoint content database. | |
12. | Once the connection to the database is completed, you are presented with the tables, views and stored procedures in the SharePoint content database. Expand the Views node in the tree, and select the SQL View name that was created in step 1 above (TaskView in this example). | |
13. | You will now be able to see the fields that were selected in SQL View above, which is ready to be dragged and dropped on to the report Design View. | |