Falterfire
Falterfire

Reputation: 156

Crystal Reports Viewer: Failed to Open the Connection error

Currently I'm working on a piece of code that involves using the Crystal Reports Viewer to export .RPT files to PDF. My problem is that the code works on literally everything except the website I'm planning to eventually put it on.

When placed on the website it throws back the error "Failed to open the connection." which I believe is connected to the SQL Server connection that's formed in order to read data for the report itself.

The code itself is solid and works when used in a separate console application I built to test it whether said code is run on my local machine or on the server itself. It even runs when I test the website in Visual Studio's virtual host.

I've narrowed it down to being some sort of permissions issue, but I am not knowledgeable enough in the various permissions settings to figure out which ones specifically apply to this situation. It's worth mentioning that other pages on the website are directly connecting to the same database, but they are doing so directly through Linq instead of going through the Crystal Report Viewer.

So does anybody know which settings I need to modify in order to fix the connection error.

An added note: One of the other suggestions is to make sure there's an ODBC DNS in place that matches the one being used by the code. I have created such a DNS already.

Upvotes: 1

Views: 4593

Answers (1)

KreepN
KreepN

Reputation: 8598

Application Pool dictates how your application runs in many ways. You can probably configure the web.config to run under the credentials, or access level of your choice.

Solution for people who didn't read the comments:

Change the identity under the advanced setting's of your application pool to the desired level of access.

Glad I could help.- J

Upvotes: 1

Related Questions