I want to create a custom web part that has more than 1 filter web part and that can be connected to Report Viewer Web Part (Integrated Mode) at runtime/design time.
I searched a lot for this, but could not find a way to have single web part that is a provider to more than 1 filters.
Say for example –
- My
Report
accepts 2 parameterDepartment
andRegion
. - I want to connect both parameters with single web part having two drop down (one for
Department
and one forRegion
) - Values from both the drop down should be passed to
Department
andRegion
Report
should be rendered in Report Viewer Web Part
Solution Tried so far
- Create a web part that adds two custom drop down
- Custom drop down class that implements from
ITransformableFilterValues
- Have 2 methods on the web pat each having
ConnectionProvider
attribute and return instance of drop down control
Problem:
Even though 2 connection option is shown on my custom filter web part only one can be added.
For example if I connect Filter1
(custom web part) to Department
then I am unable to connect it to Report Viewer
web part again.
My web part have methods like this:
[ConnectionProvider("Departmet", "UniqueIDForDept", AllowsMultipleConnections = true)]
public ITransformableFilterValues ReturnCity()
{
return dropDownDepartment; // It implemets ITransformableFilterValues
}
[ConnectionProvider("Region", "UniqueIDForRegion", AllowsMultipleConnections = true)]
public ITransformableFilterValues ReturnMyRegionB()
{
return dropDownRegion; //It implemets ITransformableFilterValues
}
Best Answer
I did something similar. This might help point you in the right direction. I used data in a form library to create a detailed report. I used reporting services and connected to sharepoint using web services. http://server/_vti_bin/Lists.asmx. The report parameter I used was the item ID or GUID. Then I configured my report viewer. On the form library I used JavaScript to override the context menu to add "View Report". On the report page I used a Query String filter to grab the item ID out of the url.