Report parameters two-way dependency

4 posts, 0 answers
  1. Diego
    Diego avatar
    8 posts
    Member since:
    Jul 2017

    Posted 12 Jul 2017 Link to this post

    Hello,

    I have a report with two report parameters (Cities and Streets).

    My SQL query looks like:

    City ID   |   City Name   |   Street ID   |   Street Name
        1        |     Paris         |         1         |     Street P1
        1        |     Paris         |         2         |     Street P2
        2        |     London     |         3         |     Street L1
        2        |     London     |         4         |     Street L2
        3        |     Rome       |         5         |     Street R1

    Now I want to have a two-way dependency between these two dropdowns.

    That means:
    1. If I choose a city from the cities dropdown, I want to see only the streets of the choosen city in my streets dropdown.
    2. If I choose a street from the streets dropdown, I want that the city dropdown is automatically filled with the city of the choosen street.

    How can I do this?

    It was easy to create a filter for an one-way dependency (if I choose a city, I only see the streets of the city) but I do not get it out that both work.

    Thank you for any help
    Diego

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 12 Jul 2017 Link to this post

    Hello Diego,

    The functionality cannot be done via Report parameters.
    My suggestion is to switch to custom UI that implements the custom logic of two-way cascading parameters which filter each other's list of values.

    You can pass the selected values to the displayed report through the viewer's ReportSource property's Parameters collection - Report Sources.

    Regards,
    Stef
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Diego
    Diego avatar
    8 posts
    Member since:
    Jul 2017

    Posted 13 Jul 2017 in reply to Stef Link to this post

    Hello Stef,

    thank you for your quick response.

    What do you mean with "switch to custom UI"? Since your post I'm trying do to this with the Visual Studio Designer 2017.

    I had a look on the Report Sources, but I found only this:

    1.Telerik.Reporting.TypeReportSource reportSource = new Telerik.Reporting.TypeReportSource();
    2.reportSource.TypeName = "ReportLibrary1.Report1, ReportLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
    3.reportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber", "SO43659"));

    So when I paste the example and made the changes, nothing happens when I view the report.
    Maybe you have an example file with two-way cascading parameters?

    Thank you in advance.

    Regards,
    Diego

  4. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 14 Jul 2017 Link to this post

    Hello Diego,

    By custom UI I refer to controls not related directly to reports and report viewers.
    If it is a web application, you can have a Page with input fields, which the user can use to fill parameters' values and to submit the information for further usage. When you have the selected values, you can pass them to hidden report parameters through the viewer's ReportSource.Parameters collection. There is no need to configure AvailableValues for report parameters, leave them as simple String report parameters with Visible properties set to false.


    Please consider the example with custom UI in How To: Pass Values to Report Parameters.

    Regards,
    Stef
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top