Embed SQL Password into Crystal Reports RPT file

crystal-reportsodbcreportviewer

We are experimenting with Crystal Reports viewers such as this one:

http://www.thereportviewer.com/

… which can actually re-connect to the data source and re-run a Crystal Reports RPT file with live data.

However when running the report the viewer asks for a password to connect to the data source (in this case SQL Server).

Does Crystal Reports have some way of embedding a connection password into a RPT file to avoid this? Or should I be using a System DSN from the Control Panel/ODBC thing to get around this?

I figure someone else must have had this problem.

Best Answer

You can't do that. If possible set the password in the DSN or use a Report Viewer that can store the passwords for you. You can of course also build your own .NET report viewer, which isn't very hard to do if you've got .NET knowledge.

Added on April 29, 2010:

What you can try is doing the following: Connect to a "ODBC (RDO)" via "Create Connection" in Crystal Reports. At the bottom of the dialog you'll find an option to enter a connection string. A connection string can contain the login info, like the example below.

Example connection string: DSN=;DB=;UID=;PWD=password