Solved

Crystal Report with the ability to dynamically change database name.

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

867 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

16 Experts available now in Live!

Get 1:1 Help Now