I want to create a report that just shows the top 5 records for use in a dashboard. (I'll link to another page with the full results.) I want the number top number (5 inthis case) to be configurable, so I created a report parameter, RecLimit, which is an Integer with a default value of =5. To limit the records I created a filter on the report and used the Top N operator, so my filter looks like this:
Expression: =RowNumber()
Operator: Top N
Value: =Parameters.RecLimit
When I preview the report, one of two things happens. If the report parameter UI.Visible property is set to True then I get the error "Filter cannot be evaluated. Value should evaluate to Integer." If the visibility is set to False then the report displays with all the records. The Top N filter is ignored.
If I run in debug I see this stack trace:
System.InvalidOperationException: Filter cannot be evaluated. Value should evaluate to Integer.
at Telerik.Reporting.Processing.Data.TopBottomFilterOperator.Create(IEnumerable`1 filters, Object context)
at Telerik.Reporting.Processing.Data.RuntimeDataSource..ctor(Object dataSource, String dataMember, IEnumerable`1 filters, IEnumerable`1 sorting, Object expressionContext, String name)
at Telerik.Reporting.Processing.Data.RuntimeDataSource..ctor(IDataSource dataSrc, Object expressionContext)
at Telerik.Reporting.Processing.ReportDataSource..ctor(IDataSource1D dataSource, Boolean detailGroup, Object expressionContext)
at Telerik.Reporting.Processing.Report.ProcessItem()
at Telerik.Reporting.Processing.ReportItemBase.Process(DataMember data)
Doesn't RowNumber() return an Integer?
What am I doing wrong here?
I created the report with Reporting Q2 2009 (version 3.1.9.807).