SAP Knowledge Base Article - Public

1351364 - Database logon requested when using NT authentication in Visual Studio .NET application

Symptom

Logon failure for subreport results in database logon screen if second table in the main report is from a trusted connection.

Reproducing the Issue

  • Create a Crystal report on two ODBC datasources with the first datasource using SQL authentication and the second datasource using NT authentication
  • Insert a subreport that uses a third ODBC datasource which uses SQL authentication
  • This report will run with no issues in the Crystal Reports designer
  • Using the below VS .NET code results in database logon for the subreport
'Load Report
CRReport.Load("C:\Users\Main\Desktop\" & "ConnectionTest3.rpt")
Dim conn As CrystalDecisions.Shared.IConnectionInfo
'Connection 1
conn = CRReport.DataSourceConnections.Item(0)
conn.IntegratedSecurity = False
conn.SetConnection("Data1", "Database1", "SA", "PW")
'Connection 2
conn = CRReport.DataSourceConnections.Item(1)
conn.IntegratedSecurity = True
conn.SetConnection("Data2", "Database2", True)
'SubReport
Dim mySubreport As ReportDocument = CRReport.OpenSubreport("SUB3.rpt")
conn = mySubreport.DataSourceConnections.Item(0)
conn.IntegratedSecurity = False
conn.SetConnection("Data5", "Database3", "sa", "PW")
'Display Report
myCrystalReportViewer.ReportSource = CRReport

Resolution

  • The issue has been submitted for a resolution.
  • Tracking number is 5000110015
  • The above escalation has been rejected.
  • Available work-around is to verify the database connection:
Dim mySubreport As ReportDocument = CRReport.OpenSubreport("SUB3.rpt")
conn = mySubreport.DataSourceConnections.Item(0)
conn.IntegratedSecurity = False
conn.SetConnection("Data5", "Database3", "sa", "PW")
CRReport.VerifyDatabase()

Keywords

KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

Crystal Reports 2008 V1