David,
create a new parameter for your reporting. You can give it a hardcoded list
of values (if you know the column names will not change), or you can create a
dataset that returns the column names you want to be available for your order
by.
Once that parameter is in place, you'll have to modify your sql (stored proc
or adhoc) so that it takes in that new parameter (we'll call it "@orderCol").
If you are using dynamic sql, by building your sql string, then just
concatenate the value of the parameter to the order by clause:
@sql = 'SELECT * from tblA'
@sql = @sql + ' ORDER BY ' + @orderCol
Hope this helps you.
--
Regards,
Thiago Silva
[quoted text, click to view] "David" wrote:
> How do you pass a parameter from Reporting Services to SQL query (Dataset)
Hi David,
I agree with Thiago that you'll need to use a store procedure which take
such a paramter to do the work since the order by column name need to be
specified statically if you do not use 'exec' command to execute the query.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no
rights.)