Skip to Content
Former Member
Nov 11, 2009 at 07:54 PM

Troubleshooting Reports-DB Connectivity at Runtime


We have an application serving some reports to the users. Reports are written in CR 2008 Pro and the .Net version is 3.5SP1. The database is SQL Server 2008. (IIS6 + Windows 2K3)

Within this application we have a few pages that access data using ADO.Net and then we have the CR reports.

Each report, at the initialization time, is dynamically re-configured with the correct database connection parameters.

I have that initialization code below. And I should add that the code behaves perfectly on all other installations we have had.

In this particular installation however all reports produce "Database Logon Failed" shown inside the web version of CR report. The pages which do not use CR and have their own data presentation they all work fine. So I cannot blame the database connectivity. Furthermore I have been able to connect to the database using various other tools such as sqlcmd and using the same crendentials. SQL server logon is used.

Are there any troubleshooting steps that we can take to find out details of error that Crystal Reports runtime encounters?

Can we force the CR runtime to produce detailed log of some sort? Are there simpple utilities provided by SAP that we can run to specifically pinpoint the problem?

thanks a lot


protected override void OnInit(EventArgs e)


// set title


System.Data.SqlClient.SqlConnectionStringBuilder sb = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);

CrystalDecisions.CrystalReports.Engine.ReportDocument reportDoc = ReportSource.ReportDocument;

if (sb.IntegratedSecurity)


reportDoc.DataSourceConnections[0].SetConnection(sb.DataSource, sb.InitialCatalog, true);




reportDoc.DataSourceConnections[0].SetConnection(sb.DataSource, sb.InitialCatalog, sb.UserID, sb.Password);

reportDoc.DataSourceConnections[0].SetLogon(sb.UserID, sb.Password);

reportDoc.DataSourceConnections[0].IntegratedSecurity = false;