Solved

Crystal Report with the ability to dynamically change database name.

Posted on 2009-05-08
3
562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

738 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