locked
Custom Multi Filter Web Part for Report Viewer RRS feed

  • Question

  • 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 runt time/design time.

    I searched a lot but could not find a way to have single web part that is a provider to more than 1 filters.
    Say for example -
    1. My Report accept 2 parameter Department and Region. 
    2. I want to connect both parameter with single web part having two drop down (one for Department and one for Region)
    3. Values from both the drop down should be passed to Department and Region
    4. Report should be rendered in Report Viewer Web Part

    Solution Tried so far
    1. Create a web part that adds two custom drop down
    2. Custom Drop down class that Implements from ITransformableFilterValues
    3. Have 2 Methods on the web pat each having ConnectionProvider Attribute and return instance of drop down control
    Problem:
    1. Even though 2 connection option is shown on my custom filter web part only one can be added
    2. For example - If I connect Filter1(custom web part) to Department then i am unable to connect 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 
            } 
      

    Wednesday, November 26, 2008 9:14 PM

All replies

  • 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 runt time/design time.

    I searched a lot but could not find a way to have single web part that is a provider to more than 1 filters.
    Say for example -
    1. My Report accept 2 parameter Department and Region. 
    2. I want to connect both parameter with single web part having two drop down (one for Department and one for Region)
    3. Values from both the drop down should be passed to Department and Region
    4. Report should be rendered in Report Viewer Web Part

    Solution Tried so far
    1. Create a web part that adds two custom drop down
    2. Custom Drop down class that Implements from ITransformableFilterValues
    3. Have 2 Methods on the web pat each having ConnectionProvider Attribute and return instance of drop down control
    Problem:
    1. Even though 2 connection option is shown on my custom filter web part only one can be added
    2. For example - If I connect Filter1(custom web part) to Department then i am unable to connect 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 
            } 
      


    I have exactly the same requirements. I've been search solution to this since long but could not find anything. I tried implemeting IWebPartParameters but the connection of this type is not recognized by report viewer web part.

    Did you worked out any solution to this problem?
    Bhavesh
    Wednesday, May 27, 2009 10:51 AM
  • i have the same probelm

    i could not find the solution

     

    Sunday, April 11, 2010 2:12 PM
  • Hello All,

     

    I'm on the same boat. we found a few gaps on the existing PerformancePoint Filter, I feel the same way about having/creating a single Webpart that can be configure to host multiple Filter Dropdowns and then connected to the different Report Objects.  I'm looking to also add Cascading Capabilities as seen on SSRS.

     

    Any thoughts?

    -HC

    Thursday, May 6, 2010 2:20 PM
  • Hello All,

     

    Me too facing the same issue, does any one got the solution.

     

     

    -Adluri

     

     

     

     

     

    Monday, March 7, 2011 8:23 PM
  • Hi,

    check the below link, how to build the custom filter webpart provider

    http://blogs.msdn.com/b/edhild/archive/2007/03/28/how-to-build-a-custom-filter-provider-web-part.aspx


    Anandhan.S
    Wednesday, August 10, 2011 7:01 AM
  • I used the IWebPartParameters interface

    Try run you web part in Debug and then in the SetConsumerSchema method do a QuickWatch on the passed schema to see what the consumer web part is expecting in the dictionary

     

    Friday, October 7, 2011 9:38 AM
  • I am desperately searching for this too :(

    Merin

    Thursday, May 31, 2012 1:40 AM
  • I had the same problem. Only solution I could find out was to pass multiple values with some string separate and split those values in Report

    Code in webpart

    public virtual ReadOnlyCollection<string> ParameterValues
    {
    	string[] values = new[] { ProjectCode + ";" + ProjectName };
    	return new ReadOnlyCollection<string>(values);
    }
    In SharePoint page make connection with a Report Parameter. Lets say param name is ConnectionParam

    Code in Report

    Param1 = code.getParameterValue(Parameters!ConnectionParam.Value, 1)
    Param2 = code.getParameterValue(Parameters!ConnectionParam.Value, 2)


    public function getParameterValue ( ByRef param() As Object, index As Int) As String
    .
    .
    .
    End Function
     

    Regards,
    Ojas Maru (My blog)


    • Edited by Ojas Maru Thursday, July 19, 2012 12:56 PM
    • Proposed as answer by Ojas Maru Thursday, July 19, 2012 12:56 PM
    Thursday, July 19, 2012 12:55 PM