views:

415

answers:

2

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.

+1  A: 

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

I tried using a User DSN and it didn't seem to remember the password. Is there a certain sort of DSN that should be used?
codeulike
I have modified my original answer to add a possible solution.
In the end, wrote my own viewer using asp.net and the CrystalReportViewer
codeulike
A: 

Hi, we had this problem too, but are currently assessing sabrelogic logicity viewer. It will store the username and password in a separate file, which call up, and runs the report. It has the advantage that I can store the reports in a central location, and just send out the file that calls up each report to each user, simplifying the problem of making changes to a report that has been distributed. Sabrelogic

The only donwside that I have found with it to date is that it doesn't handle dynamic parameters very well.

Aaron Marshall