This is a migrated thread and some comments may be shown as answers.

Report parameters two-way dependency

3 Answers 77 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Diego
Top achievements
Rank 1
Diego asked on 12 Jul 2017, 11:51 AM

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

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 12 Jul 2017, 04:35 PM
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
0
Diego
Top achievements
Rank 1
answered on 13 Jul 2017, 01:27 PM

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

0
Stef
Telerik team
answered on 14 Jul 2017, 04:34 PM
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
Tags
Report Designer (standalone)
Asked by
Diego
Top achievements
Rank 1
Answers by
Stef
Telerik team
Diego
Top achievements
Rank 1
Share this question
or