There are times when you need to set the datasource location on a report to your database. This can occur if someone else writes a report for you or if you are updating an old report.
NOTE: There is also a video on this topic but be aware, it does NOT contain as many details or the MET/TEAM version 2.2 info provided in this article.
Follow these steps:
1) Open the report from Crystal Reports
2) Click the Database menu.
3) Select Set Datasource Location from the list.
4) Select your database name from the list or click Create a New Connection:
If you are creating a new connection continue these steps:
NOTE: These steps are only valid for 2.1 and earlier versions of MET/TEAM. As of MET/TEAM version 2.2 the ODBC (RDO) provider is being used. Skip to section 4a if you are using MET/TEAM version 2.2 or later, continue with the step below if you are using 2.1 or earlier versions of MET/TEAM.
- Select SQL Server Native Client 10 from the provider list:
Enter or click the down arrow to locate your server name, enter your database name, click "Integrated Security" or use the username and password that gives you read access to the SQL database and click Finish:
4a) Steps to creating a connection for MET/TEAM 2.2 and later, if you are using MET/TEAM versions 2.1 and earlier, skip to step 5.
- Select ODBC (RDO) from the provider list:
- Select "Enter Connection String" and enter "DRIVER=SQL Server" as shown below.
- Press the Next button and on the ODBC (RDO) screen, select the server to connect to from the dropdown, click "Trusted Connection" or enter user credentials and select the METTEAM database from the Database dropdown.
NOTE: It is common for the lists to NOT populate and you have to manually type in the server and database information.
- Click Finish.
5) Connecting will bring you back to the Set Datasource Location screen, but now you will see your database with a + sign next to it:
Highlight the server name that exists in the report on the top half of the screen,
Highlight your server name on the lower half of the screen:
Test your report again. If this doesn't fix the issue and the table, view or stored procedure still cannot be found, follow the steps below:
Expand the database icon (in my case metteam) in the lower half of the screen, by clicking the plus sign.
1.Expand dbo under the database name.
2.Expand tables, views or stored procedures, depending on what is used in the report that you want to update. In my case I need stored procedures and views:
3.Highlight (just by clicking on it) the first table in the top section of the screen under the server name (in my case Stds_Used).
NOTE: Sometimes items names do NOT match the actual name of the object being used so it is always a recommended you follow the steps below whenever re-mapping report objects.
In this example, I happen to know that Stds_Used maps to a table of a different name in MET/TEAM. if you don't know what it maps to or what to verify the actual object name, simply expand the table and expand the properties to see:
Specifically pay attention to the "Table Name" property which lists the name of the 'real' object.
Here are specific examples of this in the "Cal Cert w TSR.rpt" report...
In the main report, the "vw_CallSheets" object is actually "vw_CallSheetsWithAttCheck" so you need to select the "Replace with" object that matches the "Properties" value, not the displayed name.
And the other one with a similar issue...
If 'misnamed' objects are found, they can be renamed later, see the "Tip" section at the end of this article for instructions.
4. Continue to find the tables, views and stored procedures in your report that require mapping and follow the same process of highlighting it in the top section and in the bottom and clicking update
5. Once you are finished, click to Close the "Set Datasource Location" page.
6. Click File, Save. Then test your report.
Here is a tip to fix the mismatched name issue:
When finished using the "Set Datasource Location" to correctly select the desired objects and saved your report. You can now rename the objects to their correct or 'real' name. To do this, click Database--> Database Expert..., then in the "Selected Tables" list on the right, right click on misnamed object and select rename and change the name to the actual object and click off the name to save. In the case shown above "Stds_Used" would be renamed to "Ver_8_Stds_Vw". When finished click OK to close the "Set Datasource Location" window.
Repeat the same steps for any other objects that need to be renamed. Be aware that if the object to be renamed was in a sub report, you first need to open the subreport and when it's open, click Database--> Database Expert... When the "Database Expert" opens, repeat the steps above.
For updating pre-version 2.2 reports for use in MET/TEAM version 2.2 and later, be aware that the data type of all the primary keys, n...UID, fields has changed from a number to UniqueIdentifier. Crystal now sees these fields as strings instead of numbers, so it does NOT 'auto map' them. Instead you need to uncheck the Match type check box which will then allow the matching field to show up in the available fields list on the right.
When finished making changes, you want to save your report and retest to ensure everything is correct.