Wednesday, February 15, 2012

Dynamic SQL in a RDL file?

Can I put parameters and change the SQL in a dataset using expressions?
Thanks
ScottYes. It is a little tricky but totally doable. First, make sure you have
your expression creating the appropriate SQL String. I usually create the
report with no dataset, just the parameters and then a textbox set to the
expression. This allows me to see the resultant SQL prior to using it for
the dataset. Then I like to first use a static query so that the field list
gets populated. Then (from the generic query window) set the SQL to the
expression. i.e. in the generic query window put
= iif(blah blah, blah, blah) & "whatever else your expression consists of" &
"etc etc"
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:emp%23Bf65EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Can I put parameters and change the SQL in a dataset using expressions?
> Thanks
> Scott
>

No comments:

Post a Comment