Monday, March 12, 2012

Multiple Database Parameter

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,
RyanIf 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
"Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
news:893663B7-32A2-4814-BB02-B0E6F5834CD7@.microsoft.com...
>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,
> Ryan|||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
"Bruce L-C [MVP]" wrote:
> 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
> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
> news:893663B7-32A2-4814-BB02-B0E6F5834CD7@.microsoft.com...
> >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,
> > Ryan
>
>|||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
"Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
news:A8F14883-6F1B-4E97-90FD-5DCAB8B15F64@.microsoft.com...
> 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
> "Bruce L-C [MVP]" wrote:
>> 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
>> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
>> news:893663B7-32A2-4814-BB02-B0E6F5834CD7@.microsoft.com...
>> >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,
>> > Ryan
>>|||Bruce,
I tried this and no luck. Any other thoughts?
Ryan
"Bruce L-C [MVP]" wrote:
> 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
> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
> news:A8F14883-6F1B-4E97-90FD-5DCAB8B15F64@.microsoft.com...
> > 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
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> 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
> >>
> >> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
> >> news:893663B7-32A2-4814-BB02-B0E6F5834CD7@.microsoft.com...
> >> >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,
> >> > Ryan
> >>
> >>
> >>
>
>|||="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
"Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
news:C8F61505-7D51-43D4-AB32-5D40A963788B@.microsoft.com...
> Bruce,
> I tried this and no luck. Any other thoughts?
> Ryan
> "Bruce L-C [MVP]" wrote:
>> 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
>> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
>> news:A8F14883-6F1B-4E97-90FD-5DCAB8B15F64@.microsoft.com...
>> > 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
>> >
>> > "Bruce L-C [MVP]" wrote:
>> >
>> >> 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
>> >>
>> >> "Ryan Mcbee" <RyanMcbee@.discussions.microsoft.com> wrote in message
>> >> news:893663B7-32A2-4814-BB02-B0E6F5834CD7@.microsoft.com...
>> >> >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,
>> >> > Ryan
>> >>
>> >>
>> >>
>>

No comments:

Post a Comment