Solved

Crystal Report with the ability to dynamically change database name.

Posted on 2009-05-08
3
553 Views
Last Modified: 2012-05-06
I work in an environment (like everyone else) that consists of a production database and a test database.  My test environment is an exact image of my production database.  What I'd like to do is to create a Crystal Report that works for both environments...if this is possible.  Basically, I'd like for my users to be able to run reports in our testing environment without having to re-create all of my Crystals to point towards the test database.  Having two sets of each Crystal isn't something that I'd like to do...or maintain.

Basically I'd like to just change the database name dynamically at runtime.

Thanks in advance,
Corey
0
Comment
Question by:CoreyAnt
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24338711
You can use the same report.

There are 3 ways to do this.
Use the SET DATABASE LOCATION to alternate as required

Use an application to run the reports and change the database through code.

If the test and prod are physically separate networks you could set the TEST network up to look exactly like the PROD network including server names.  In that way the report doesn't know anything has changed.  That is what we di and never had a problem moving reports from one to the other.

mlmcc
0
 

Author Comment

by:CoreyAnt
ID: 24338835
Sorry for my ignorance but you say "SET DATABASE LOCATION", how/where would I use this code?  Because if this is code that I could use within the actual Crystal, I think that'll be the way I'd like to go.

Corey
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 24340199
This assumes it is a full version of Crystal not a VS version.
Open the report in Crystal
Click DATABASE --> SET DATABASE LOCATION
The steps from here are version dependent.  I don't have CR9 so I am not sure how they do it.
CR XI has 2 windows on the popup.
Top one is the report database location
Bottom one allows you to navigate to a new database

mlmcc
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Import New Records From Access Table To SQL Database Table 7 32
Powershell v3 - SQLCMD 3 27
SQL USE DATABASE VARIABLE 5 30
SQLCMD Syntax 2 15
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question