Differences

This shows you the differences between two versions of the page.

Link to this comparison view

how_to_create_a_dsn_file [2019/01/17 09:04] (current)
Line 1: Line 1:
 +
 +
 +
 +
 +This page describes how to create a DSN file, which will allow you to modify reports through Crystal Reports.
 +
 +
 +
 +===== Concept =====
 +
 +
 +
 +In order to create a custom report or modify a standard report in Crystal Reports, you will need to establish a link between your report and your Control database. This link is called an ODBC (Open Database Connection) link. It allows you to communicate with your database so you can pull tables and fields directly out of your database onto your report. The ODBC is stored in a .dsn file that gets created everytime you preview a report in Control. If you open your .dsn file in Notepad, you'll see that all of the necessary information needed to connect to your database is there - server name, database name, user name, password, etc...
 +
 +
 +
 +===== Cautions =====
 +
 +
 +
 +As with any report changes, be sure to make a backup of your report before making changes to it. The only other caution would be to make sure you are using the correct version of Crystal Reports. If your reports are designed to work in SMS, you'll need to use Crystal Reports version 8.5 to modify reports. If your reports will be used in Control, you'll need to use Crystal Reports version XI to modify reports. Note that these versions are not backwords compatible.
 +
 +
 +
 +===== Steps =====
 +
 +
 +
 +1. Our first step is to create a .dsn file. This can be done one of three ways:
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ A. Use the .dsn file that Control creates everytime you open a report in Control </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 1. Open Control and open and report in Control. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 2. Keep Control open and open your My Computer icon. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 3. In the address bar, type "​%temp%"​ (no quotes). This will open up the local Temp folder. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 4. You should see a folder called "​Control...."​. Inside of that folder, you should find a file called "​DNSFile....DSN"​. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 5. Copy that file to a location that your computer with Crystal Reports installed on it can access. Feel free to rename the file. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ B. Use the GenericDSN.DSN file that implementation can give you </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 1. Copy the file to a location that your computer with Crystal Reports installed on it can access. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 2. Right click on the file. Click Edit. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 3. Enter your server name where it asks you. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 4. Save the changes. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ C.  To manually create a DSN file: </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 1.  Open NotePad </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 2.  Copy the contents of the DSN file below </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 3.  Update the following fields: </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">>​ a. Check the SQL database name for DATABASE (usually StoreData by default). </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">>​ b. Update your UserName in WSID. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">>​ c. Update the SQL Server and Instance name for SERVER. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ 4. Save the file with the .DSN extention. (We recommend using Control.DSN or something to identify it.) </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 40px;">​ </​code>​ </​div></​html>​
 +
 +
 +
 +[ODBC]
 +
 +
 +
 +DRIVER=SQL Server
 +
 +
 +
 +UID=cyrious
 +
 +
 +
 +Trusted_Connection=No
 +
 +
 +
 +DATABASE=StoreData
 +
 +
 +
 +WSID=CRYSTAL19-UserName
 +
 +
 +
 +APP=Cyrious Control - Ver. 04.50.1108.1202 ODBC
 +
 +
 +
 +SERVER=CRYSTAL19\SQL2008R2
 +
 +
 +
 +</​code>​
 +
 +
 +
 +2. The next step is to use the DSN file to link to your database.
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ A. Open your report in Crystal Reports. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ B. Click Database > Set Database Location </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ C. On the ODBC (RDO) screen, select Find File DSN and navigate to your DSN. Click Next. </​div></​html>​
 +
 +
 +
 +<​html><​div style="​margin-left:​ 20px;">​ D. Your username is cyrious and your password is __Contact Cyrious Tech Support for Password__ and ask for the password to the cyrious user in SQL for Control. </​div></​html>​
 +
 +
 +
 +3. You should then be able to add and remove tables and/or fields as needed.
 +
 +
 +
 +===== Source =====
 +
 +
 +
 +Contributor:​ Cyrious Software
 +
 +
 +
 +Version: Control 3.1+
 +
 +
 +