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

Using simple Textbox search with Report Parameters

1 Answer 700 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 27 May 2018, 07:58 AM
I have a very simple need but cannot find an answer anywhere. I am using a Html5 Web Forms Report Viewer. I am displaying a table with a few types of columns. One of the columns displays data for various addresses (ie. 399 Main Street). I want to search that field so I set up a simple report parameter on the main part of the report - outside the table structure and then set up a filter inside the table using the name of this field for this expression (= Fields.FullAddress), a 'Like' operator and finally the parameter (= Parameters.Address.Value). This parameter structure sets up a textbox as a search editor, which is what I want. From this point on, the functionality I'm looking for is to type in part of an address and to use the value of the textbox to resolve a 'LIKE' expression, as the filter states. When I run the report, I don't get any values at all, no matter what I put into the textbox. I'm not sure what I am missing here. Maybe I'm missing the whole concept the 'Like' filter. Can anybody help me on this?

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 29 May 2018, 11:18 AM
Hi Terry,

Below is quote from my response in your support ticket on the same question:

"In general, in the Value column of the Filter operator Like you need to provide a string literal. So if you provide a constant string, that does not change for the different runs of the report, you can use for example %Street%. The "%" wildcard represents any number of other characters.

However, in this case, you need to provide different values for different runs of the report using report parameter. So, you have to use an expression, that will be evaluated to different strings at run-time based on different values of the parameter. For example, Edit Filters dialog could be configured like following:
Expression: = Fields.FullAddress
Operator: Like
Value: ="%" + Parameters.Address.Value + "%"

The difference is that you have to concatenate the wildcards with the parameter in an expression so when the filter is evaluated the correct value will be used. For example if the value of the Address parameter is "Street" after evaluation the filter will be executed with "%Street%" value. 

Please note that the input filed is in case-sensitive.

For additional information please see the following help topics: 
Using Expressions
Filter Rules"


Please let us continue the discussion in one of both threads in order to keep a better track on the exchanged information.
Thank you for your understanding.

Regards,
Silviya
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
General Discussions
Asked by
Terry
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or