Skip to Content

Can we use Crystal Reports for Visual Studio to change database Server easily?

Hi, everybody

I often develop reports using stored procedures and SAP Crystal Reports 2011 (the stand alone version).

I get a very annoying problem when we change Server (but database, fields, etc. remain the same).

Unfortunately, changing Servers happens more often than I anticipated:

e.g. (1) when we change from development database to production database

(2) when the server crashes, and we must create another one.

The problem is that when we change Servers, and have to modify our Crystal Reports to point to that Server, all the fields drop off (disappear from the reports!). Our reports are useless and must be redesigned practically from scratch. When we have many reports, with many subreports, and many formulas, this can be a very discouraging situation.

One forum solution would be to insert formulas (containing the field names) to the report canvas instead of the actual field names.

This works, but when we change Server, it is still an arduous task to change the name of the Server on all the hundreds of formulas in the report so that they point to the new Server. The fields don't drop off, but the problem now is to modify all those formulas.


I was wondering if we could use Crystal Reports for Visual Studio to solve that problem.

I am newbie in CR for VS, and may be I'm dreaming. So please excuse me if I write some nonsense.


I am dreaming of a scenario like this one:

  • I use Visual Studio (VB.NET) to design my Crystal Report application.
  • In the form load event, I would put the code to set the ConnectionInfo Class.
  • . ServerName = "Server1
  • . DatabaseName = "ABCcompany1"
  • . UserID = "sa"
  • . Password = "12345"
  • Then I would design my Crystal Report and its subreports.
  • If ever I have to change Server, I would go back to the design stage and simply modify the ServerName to say "Server2" , and modify the other connection details if necessary.
  • Of course, I will have to copy all my database tables, stored procedures, functions, etc. from Server1 to Server2.
  • I imagine that my Crystal Reports will work correctly with my new server without any need to modify anything on the report.


Am I right, am I wrong?

Please suggest if CR for VS can be a solution to my problem of dropping fields, and let me know (in broad terms) how I can proceed.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 23, 2017 at 01:36 PM

    See if the samples on this page help you, it has VB code so you don't have to convert.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2017 at 10:21 PM

    You need to use ReplaceConnection to update the Server name.

    On the download page there is a Parameter Sample app that does logon and replaceconnection.


    Add comment
    10|10000 characters needed characters exceeded

    • Call our Professional Service to write an app for you would be all I can suggest then.

      Or just run in debug mode and watch what is going on in the various collections...

      Use Google and search, I also wrote a KBA on how to use ReplaceConnection().

      Good luck