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

ReportParamters and Filtering Question

1 Answer 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wendy Hunt
Top achievements
Rank 2
Wendy Hunt asked on 29 Apr 2010, 04:25 PM
I have a report that I have created 2 report parameters for... they are Tier and Organization.  They are both pulling from the database a selection list.  My issue is this... you are required to make a selection from the dropdownlist and there is no default data that populates the report until you make your selections.  You have to make selections from Tier and Organization for the report to populate.  I would like it if I could select a Tier, then for Organization it would pull up all of them for that Tier.  and visa...versa if I pulled up an Organization, then for Tier it would pull up all of them for that Organization. 

My selections in the database for TIer are 1, 2, 3, 4, 5.  I would like it if there were an extra selection ... something like "All" or "Default" to indicate Tier as a wildcard... so to speak ... that would pull up all the Tiers in the database.  I don't want the User to be stuck with only making the selections from the database.

Any suggestions on how to use the report properties tool to make this happen would be fabulous.

Thanks!
wen

Here are my selections for Tier in the properties...
ReportParameters:
AllowBlank True
AllowNull False
DataSource sqlDataSource1[TelerikReporting.SqlDataSource]
DisplayMember = Fields.Tier
Filters (No Filters)
Sorting (No Sorting)
ValueMember = Fields.Tier
Mergable True
Name Tier
Text Tier
Type Integer
Value
Visible True

Page Properties...
Filters:
=Fields.Tier =  = Paramaters.Tier.Value
And = Fields.Organization =  = Parameters.Organization.Value

1 Answer, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 04 May 2010, 06:33 PM
Hi Wendy Hunt,

We call a parameter which depends on another parameter a cascading parameter. The available values of the cascading parameter depend on the value of another parameter. There is no way to make cycled cascading parameters using the automatically generated UI (the option is to create your custom UI and pass the selected parameter values to the report).

For more information about cascading parameters, you may review:
Report Parameters
How-To: Cascading Parameters with applied filtering on data source level

The other requirement, however, may be accomplished easily:
What you want is to ignore the parameter. Just make the parameter nullable (AllowNull = true) and then in the report item filter instead of:
=Fields.Tier =  = Parameters.Tier.Value
use:
=Fields.Tier =  = IsNull(Parameters.Tier.Value, Fields.Tier)

If you still want the parameter not to be nullable and a special value to be displayed in the drop-down, do the following:
If your select statement for the report parameters available values is for example:
SELECT Tier FROM Tiers
change it to something like
SELECT '-Default-' AS Tier UNION ALL SELECT Tier FROM Tiers
Then in the report item filter use:
=Fields.Tier =  = IIf(Parameters.Tier.Value = '-Default-', Fields.Tier, Parameters.Tier.Value)

Give it a try and write us if you need further assistance.

Sincerely yours,
Milen
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Wendy Hunt
Top achievements
Rank 2
Answers by
Milen | Product Manager @DX
Telerik team
Share this question
or