SAP Knowledge Base Article - Public

1425929 - Database logon prompt when launching a report in a Visual Studio .NET application

Symptom

  • Database logon screen at runtime (VS .NET 2008).Main report runs with no errors when the subreport is removed.
  • Subreport runs with no errors when run as a main report.
  • Logon screen only appears when the subreport is inserted into the main report.

Reproducing the Issue

  • Structure the report as follows.

Main report

  • Connection 1 to ODBC datasource, database 'A', using SQL authentication
  • Connection 2 to ODBC datasource, database 'B', using NT authentication

Subreport

  • Connection 3 to ODBC datasource, database 'C' using SQL authentication
  • In Visual Studio .NET connect the report to the datasource as described in Crystal Reports .NET SDK help files

Cause

The NT authentication is being propagated to the subreport.

Resolution

Verify the database after the database connection is set to the subreport.

'SubReport

  Dim mySubreport As ReportDocument = CRReport.OpenSubreport("SUB3.rpt")

  conn = mySubreport.DataSourceConnections.Item(0)
  conn.IntegratedSecurity = False
  conn.SetConnection("Data5", "Database3", "sa", "PW")

 CRReport.VerifyDatabase()

'Display Report

  myCrystalReportViewer.ReportSource = CRReport
 

Keywords

KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

Crystal Reports 2008 V1