cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change connection information using CrystalReport VCL for Delphi?

Former Member
0 Kudos

Hello.

We are using CrystalReport XI with Delphi CRPE VCL component. The database connectivity used within the report is ADO. The follwing is basically what we are trying to do:

var

CRPEReport: TCrpe;

begin

CRPEReport:= TCrpe.Create(Self);

try

CRPEReport.ReportName := ReportPath;

if CRPEReport.HasSavedData then

CRPEReport.DiscardSavedData;

CRPEReport.Connect.ServerName := 'New Server';

CRPEReport.Connect.DatabaseName := 'NewDatabase';

CRPEReport.Connect.UserID := 'dbo';

CRPEReport.Connect.Password := 'dbopass';

CRPEReport.Connect.Propagate := True;

CRPEReport.Show;

finally

CRPEReport.Free;

end;

end;

The preview shows data from database that the report was desgined with and it completely ignores the connectivity setting that I put in the code. What am I doing wrong??? Please help. Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

You have to use the ConnectBuffer. See [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note for details.

Also, consider searching the notes database:

https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true

The search; VCL database crystal, returns a number of notes that may be of use.

Ludek

Former Member
0 Kudos

Yep.

Replacing the connection stirng on the fly worked.

Thanks for your help.

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

As per the header at the top of this forum:

This forum is dedicated to topics related to custom application development or deployment with Crystal Reports in .Net. This includes full versions of Crystal Reports as well as those versions of Crystal Reports bundled with Microsoft Visual Studio .Net.

Thus moving this thread to the appropriate forum.

Ludek

Former Member
0 Kudos

Unless this was a cross post this is the Legacy Application Development forum - which should NOT include .NET

former_member183750
Active Contributor
0 Kudos

??

I moved the post to legacy as this is the VCL and Delphi.

Ludek

Former Member
0 Kudos

Sorry - missed the "Moved the thread" part of your response.