Solved

Crystal Report with the ability to dynamically change database name.

Posted on 2009-05-08
3
525 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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 shrink a transaction log file down to a reasonable size.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now