Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Pass Parameters and select from Parameters

Author  Topic 

candyme
Starting Member

4 Posts

Posted - 2006-10-16 : 04:41:15
Is it possible to pass multi-value parameter from UI to report and upon displaying the report, allow the user to select values from this multi-value parameter? Thanks! Using RS 2005

Gerri

Will Riley
Starting Member

10 Posts

Posted - 2006-10-30 : 18:01:01
Sorry this is such a late reply...

Short answer = YES

EG. Lets say we have a simple dataset query such as

select * from acctgroup where id = @groupid

This becomes the base dataset for the report

I add a second simpler dataset as follows

select distinct id from acctgroup
order by id asc


The select Report>Parameters from the designer UI toolbar
You should see groupid listed as a parameter...
On the right hand side of the panel, you can select the datatype & a prompt the user will see. Under available values option you can select that the parameter value can be selected from the second dataset using the value field id - you can if you like select a default value or leave as Null so the report does not execute until the value is selected.

In report preview, you should now see your parameter box top left of the report with the ability to select from the dropdown which will contain the results of the dataset2 query.

Hope this helps.

The XML produced will be something like this

<ReportParameters>
<ReportParameter Name="groupid">
<DataType>String</DataType>
<Prompt>Group Select</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>DataSet2</DataSetName>
<ValueField>id</ValueField>
</DataSetReference>
</ValidValues>
</ReportParameter>
</ReportParameters>


Cheers,

Will
Go to Top of Page
   

- Advertisement -