on 06-08-2010 11:56 PM
Hi,
Crystal Reports v. 11.5.10.1263
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
Hello,
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
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
rpt.Load(rptName.ToString());
rptClientDoc = rpt.ReportClientDocument;
Thank you
Don
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.