Print Page | Close Window

How to Change datasource based on parameter value?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14145
Printed Date: 22 Apr 2025 at 4:03pm


Topic: How to Change datasource based on parameter value?
Posted By: kpsmithuk
Subject: How to Change datasource based on parameter value?
Date Posted: 22 Aug 2011 at 5:48am
Hi
 
I'm trying to create a product running history report for QA purposes however we have changed computer systems and I need my report to use one datasource (old database) if the date parameter is set to a date (date range) prior to the change, and the new database if set after the change.
 
The datasets are of very different structure in terms of the tables used and fields, my goal would be to superimpose the fields from each over each other and suppress/unsupress based on the date value.
 
There will be a problem for date ranges which would give results from both databases.
 
But without using sections in the details with the results from each db in seperate sections perhaps??? I don't see anyway of getting around this but would save writing 2 seperate reports.
 
Is what I'm proposing possible?



Replies:
Posted By: hilfy
Date Posted: 22 Aug 2011 at 9:04am

Create two subreports in your main report.  The main report will take in the parameters and pass them to the subreports.  The first subreport will connect to the old database and the second to the new one.  Each will be in it's own section of the main report.  You'll have to do a little work to make sure that the fields line up correctly as you move from one subreport to the next.

 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window