1905423 - How to pass Database logon information to a Crystal report which uses Oracle Service connectivity, using .NET SDK?

SAP Knowledge Base Article - Public

1905423 - How to pass Database logon information to a Crystal report which uses Oracle Service connectivity, using .NET SDK?

Symptom

How to pass Database logon information to a Crystal report which uses Oracle Service connectivity, using .NET SDK?

Environment

  • SAP Crystal Reports, developer version for Microsoft Visual Studio.
  • Connectivity: Oracle Service using Oracle Native Client
  • Microsoft Visual Studio 2010

Resolution

Check Oracle Service name by following below steps.

  1. Go to Start > All Programs > Oracle > Configuration and Migration Tools > Net Manager
  2. Expand Local
  3. Expand Service Naming
  4. Select service name and use the same in code.

Here is C# code for passing Database credential to a crystal report which uses Oracle Service connectivity through Oracle Native Client:

rd=newReportDocument();
rd.Load(Server.MapPath("CrystalReport1.rpt"));
CrystalDecisions.Shared.ConnectionInfo boConnectionInfo = new ConnectionInfo();
boConnectionInfo.ServerName ="Enter your oracle service name";
boConnectionInfo.UserID ="Enter your User name";
boConnectionInfo.Password ="Enter your password";
foreach(CrystalDecisions.CrystalReports.Engine.Table boTable inrd.Database.Tables)
{
CrystalDecisions.Shared.TableLogOnInfoboTableLogOnInfo = boTable.LogOnInfo;
boTableLogOnInfo.ConnectionInfo = boConnectionInfo;
boTable.ApplyLogOnInfo(boTableLogOnInfo);
}
CrystalReportViewer1.ReportSource = rd;

See Also

SAP Note: 1432440  How to change datasource location and table location of Crystal Reports report at runtime using RAS .NET SDK for Oracle Native Driver   

Keywords

oracle native client; DBlogon; database logon credential , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio