Friday, February 24, 2012

How to set connection at runtime

Hi,
Our application connects to one database in the testing environment and to a
different database in the production environment. Currently, with Crystal
Reports, we maintain a single set of reports, and at runtime, when the
reports are loaded, the application sets the report's connection acordingly:
if the application is comnnected to the production server, the report's
connection is set to the production server, otherwise to the test server.
Using MS Reporting Services, how can the report's connection be set at
runtime from the application before the report connects to the database?
Thank you in advance,
RichardHi Richard,
One way you can set the connection at runtime is through a user input
parameter. You would just have to reference Parameter!param.Value in
the connection string. There may be other ways to do it dynamically
without the user having to input data, but I am not sure if there is a
way for MS Reporting Services to tell which environment it is in. Good
luck!
Lance M.
Richard wrote:
> Hi,
> Our application connects to one database in the testing environment and to a
> different database in the production environment. Currently, with Crystal
> Reports, we maintain a single set of reports, and at runtime, when the
> reports are loaded, the application sets the report's connection acordingly:
> if the application is comnnected to the production server, the report's
> connection is set to the production server, otherwise to the test server.
> Using MS Reporting Services, how can the report's connection be set at
> runtime from the application before the report connects to the database?
> Thank you in advance,
> Richard

No comments:

Post a Comment