views:

31

answers:

1

I have a 'Product' parameter in my report. Depending on the product the user chooses, it will call the report generator stored procedure from a different data source. Looking at this article, I've found how to do the first part of this solution. I've created two internal parameters, Server and Database, and the connection string will use them to connect to the right database.

But I need to set this two parameters when the user chooses a product. How could I do this?

(If @Product = X) => @Server = Y, @Database = Z

A: 

How did I resolve this:

I didn't do the way the article suggested. Instead, I threw away this two additional parameters and just put a big Switch expression at the connection string definition. Depending on the @Product value, the switch returns a different value. It may sound uglier, but at least it works.

Victor Rodrigues