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

Report renders before the parameter is selected

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
GEB
Top achievements
Rank 1
GEB asked on 18 Aug 2010, 08:09 PM
I have a report with a single report parameter.  The report is filtered on the value of this parameter.  I allow NULL, so that the user can essentially select "ALL" records.  Using the SilverLight ReportViewer, the report runs just fine.  However, if I allow a NULL report parameter, the report runs with "all" records before the user has a chance to select a parameter.  The behavior I would expect is that the ReportViewer displays the list of valid parameter values, along with the NULL checkbox.  The user can then choose ALL by ticking the checkbox, or to filter the report by selecting a parameter value.  Then, the user would click the Preview button and the report would execute and render.

Is there any way to keep the report from rendering all records before the user specifies a parameter?  BTW, the report previewer in Vs2010 seems to work exactly the same way.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Aug 2010, 01:14 PM
Hi GEB,

By default allowing null would not show all the data. You need a proper filter expression to do this as explained in the Do not filter on null blog post. So the behavior you expect is on the opposite of how our engine works.
All report viewers are built so that whenever a valid report value is found, the reports are being processed.
This is how the current implementation works and changing it is not feasible, but we would investigate whether it is possible to do something to control this behavior.
For the time being you can make the report parameter AllowNull=false, add a "dummy" row in your database that when selected would list all records and change the filter inquiry to something like this:

Expression: = Fields.MyFields
Operator: =
Value: = IIf(Parameters.Parameter1.Value = -1, Fields.MyFields, Parameters.Parameter1.Value)

All the best,
Steve
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
GEB
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or