all groups > sql server reporting services > september 2007 >
You're in the

sql server reporting services

group:

Multiple Database Parameter


Multiple Database Parameter Ryan Mcbee
9/27/2007 10:46:02 AM
sql server reporting services:
I have a report that works well, but would like to run it for other
databases. How would I go about this? Could I create some sort of parameter
in the report to call upon a different db?

Thanks,
Re: Multiple Database Parameter Ryan Mcbee
9/27/2007 1:38:00 PM
Bruce,
I am found the following expression; "="data source="
&Parameters!ServerName.Value& ";initial
catalog="Parameters!DatabaseName.Value".

When I go to run the report, I am getting an error that says "The
ConnectString expression for the data source ‘Data’ contains an error:
[BC30277] Type character '&' does not match declared data type 'Object'"

Any thoughts on why I would get this? The connection string is exactly what
i pulled from the microsoft site.

Thanks,

Ryan

[quoted text, click to view]
Re: Multiple Database Parameter Bruce L-C [MVP]
9/27/2007 1:52:35 PM
If you are on RS 2005 you can have your data source be expression based. It
uses a parameter to determine which database to use. Search index of books
online for the word expressions and then click on data sources.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Multiple Database Parameter Bruce L-C [MVP]
9/27/2007 4:37:14 PM
I suggest creating a report with just a textbox and the parameter and set
this expression to the textbox. That way you can see what your string is
evaluating to.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Multiple Database Parameter Ryan Mcbee
9/27/2007 5:14:01 PM
Bruce,
I tried this and no luck. Any other thoughts?
Ryan

[quoted text, click to view]
Re: Multiple Database Parameter Bruce L-C [MVP]
9/28/2007 8:32:34 AM
="data source=" & Parameters!ServerName.Value & ";initial
catalog=AdventureWorks"

Above is from the books online. It is not what you are doing. You are
assembling a string that will eventually look like this.
data source=myservername;initial catalog=AdventureWorks

You've got double quotes all over the place. Again, start this with a text
box. Do not put quotes around the = sign. Just off the top of my head I
think this is what you want:
="data source=" & Parameters!ServerName.Value & ";initial catalog=" &
Parameters!DatabaseName.Value


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]

AddThis Social Bookmark Button