Showing results for 
Search instead for 
Did you mean: 

Unable to set a new report connection to Oracle

Former Member
0 Kudos


Crystal Reports v.

VS Studio 2005

Oracle client 10.2, no connectivity issues

I am changing the connection at runtime to connect to another instance of Oracle database.

the report is of type ReportDocument.

report.DataSourceConnections[0].SetConnection("name from tnsnames.ora", null, "username", "password");

It does not seem to work. It does not set the new connection.

Any input appreciated. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos


Use inProc RAS ( reportapplicationserver ) to set location using this method:

private void ModifyReportClientDocument (ISCDReportClientDocument rcd)


ConnectionInfos oldConnInfos = rcd.DatabaseController.GetConnectionInfos(null);

ConnectionInfo newConnInfo = GetConnectionInfo ();

for (int I = 0; I < oldConnInfos.Count; I++)


rcd.DatabaseController.ReplaceConnection(oldConnInfos<i>, newConnInfo, null, CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB);



Thank you


Former Member
0 Kudos

Thanks for your answer. How do I convert the ReportDocument to ISCDReportClientDocument?

0 Kudos

Something like this:

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

using CrystalDecisions.ReportAppServer.ClientDoc;

using CrystalDecisions.ReportAppServer.Controllers;

using CrystalDecisions.ReportAppServer.ReportDefModel;

using CrystalDecisions.ReportAppServer.DataSetConversion;

using CrystalDecisions.ReportAppServer.DataDefModel;


CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

ISCDReportClientDocument rptClientDoc;

When opening the report you can use both references:

rptClientDoc = new ReportClientDocumentClass();

// Common open dialog box to select the report file


rptClientDoc = rpt.ReportClientDocument;

Thank you


Answers (0)