Hi, jebba:
For including a filter into a report you must follow the next steps:
Select the report where you need to add the filter, and click "Edit" in the upper right corner of the right window (near the end of the report's name), or begin creating a new report.
When the Report Builder Wizard appears, go to the "Report Parameters" tab.
Click "Add" and then "New Parameter" to add a new parameter to the report.
Fill in the required information, taking into account that
- "Type" must be filled with "Basic GUID Parameter"
- In the "Value Provider" section, select "Filter Chooser Parameter Control"
Press the Ok button.
Once the parameter is created, select the "Data Source" tab, and in the subtabs inside it, select "Query Parameters".
Here, click "Add" and select the parameter you created previously. It is automatically added to the list of Query Parameters.
Now, you can use it safely into your query. Remember to use it between % signs. A sample query can be
SELECT * FROM CollectionMembership cm
INNER JOIN vItem i ON i.Guid = cm.ResourceGuid
WHERE cm.CollectionGUID = N'%filter%'
Take into account that filter is the name of the parameter where the guid of the selected filter is stored, and that it must be enclosed between % signs, and in this sample, also is enclosed between the single aprotrophe sign.
Hope this helps you.