Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Data connection.

Status
Not open for further replies.

northw

MIS
Nov 12, 2010
140
US
Hi All,
I need some help about the data connection.
I have a report running on two different databases, Can I includu a parameter in the report to select a particular database before running the report, Is it possible in Crystal(V 10), I know It can be done in SSRS. So, Want to clarify if It is possible in Crystal, If Possible, How is it done?


Thanks in Advance.
 
Hi,
AFAIK, that cannot be done since the database information is not re-configurable at run time.

You could save the report without any database logon info and maybe specify a different database when it prompts - but I seem to recall it only prompts for user and pass not datasource!



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If you have Crystal Reports Server and the Business View Designer, you can do this via a Business View.

The Business View can be based on a Dynamic Data Connection which you select at run time.

Business Views run on Crystal Reports Server/Business Objects Enterprise, so you will need the report delivery method to use this feature.
 

If you can link the servers then this approach would work - create a command object with a parameter that prompts for the database, assume the only allowed values are Prod and Test.

Code:
if {?Database} = 'Prod'

BEGIN

select fields from server1.database1

END

else

BEGIN

select fields from server2.database2

END

Depending on your needs you may outgrow this approach, but it can come in handy.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top