Embed SQL password in Crystal Reports RPT file?
We are experimenting with Crystal Reports readers like this one:
http://www.thereportviewer.com/
... which can actually connect to the data source and rerun the Crystal Reports RPT file with real-time data.
However, when the report runs, the viewer prompts for a password to connect to the data source (in this case, SQL Server).
Does Crystal Reports have some way to embed the connection password in the RPT file to avoid this? Or should I use the system DSN from Control Panel / ODBC to get around this?
I believe someone else had this problem.
a source to share
You cannot do this. If possible, set a password on the DSN or use a report viewer that can store passwords for you. You can of course also create your own .NET report viewer, which is not very difficult to do if you have knowledge of .NET.
Added on April 29, 2010:
Here are some things you can try: Connect to "ODBC (RDO)" through "Create Connection" in Crystal Reports. At the bottom of the dialog box, you will find the option to enter a connection string. The connection string can contain login information as shown below.
Example of a connection string: DSN =; DB =; UID =; PWD = password
To automatically connect to SQL using sa user and password in Crystal Reports
1) Create DSN file in ODBC control 2) In Create File DSN add a line with SA Password as follows:
[ODBC]
DRIVER=SQL Server
UID=sa
PWD=your_pass
DATABASE=Your_Database
WSID=YourServerName
APP=System operacyjny Microsoft® Windows®
SERVER=YourServerName\YourDatabase
Description=YourDescription
3) Connect to SQL in Crystal Report using your DSN file
You must remember that your password is easy to find, so it is very dangerous.
a source to share
In the new version of The Report Viewer, you create an overridden connection, leaving the server and database fields blank, but setting the username and password and it will work. The software will set the username and password to this value without changing other connection parameters within the report. This will stop it by prompting you for a username and password.
You can also specify the username and password inside the ODBC driver or other driver parameters, but some databases do not allow this for security reasons ... and you cannot use ODBC.
a source to share
We also had this problem, but we are currently evaluating the saber logic audience. It will save the username and password in a separate file that invokes and runs the report. This has the advantage of being able to keep the reports in a central location and just submit a file that triggers each report for each user, making it easier for me to make changes to the report that has been circulated. Sabrelogic
The only thing I've found with it to date is that it doesn't handle dynamic parameters very well.
a source to share