Add wildcard character to parameter

We have a BAQ report that allows a user to input a word to search for in a part description. When entering the word the user has to enter the wildcard character percent sign before and after the word. Is there a way to customize the option filter in BAQ report designer or the report option screen to automatically add the wildcards?

If you are using actual BAQ params then yes you could force the wildcard in. I modify params by setting the baq as updatable, on get list pre-process I grab the params modify them and then let the baq continue on as usual from there.

Just noticed this was Report Criteria, use Josh’s solution…

You can use an expression in your criteria:

Trimmed the parameter, but probably not needed…

image

1 Like

The report is not run as a simple BAQ. It is run as a report where the parameters are input via option filter from the BAQ Report designer.


image

@Mark_Wonsil amended his post once he saw that. You will need to intercept those params on the BAQ side of things and modify them. I’m not exactly sure how they pass through but they must exist in an object on that side somewhere. Instead of an object part of ExecutionParams it may come through as just a true whereclause. Best bet is to run a trace and see how the report screen sends the data and reverse engineer from there.

It looks like it gets passed on this object set. Not going to lie the submit to agent on this thing looks real weird they pass the whole XML definition in a param called “Filter1”. You’re going to have to really get into the weeds on this one.

@NSP the other thing here too is I don’t think that report params for nvarchar accept a matches comparator on my version does it on yours? If not, then for sure you will have to do some tap-dancing to make this work.

I wonder if a report from customization would work?
looks bogus I know but…if overwriting SearchPhrase is easier than entering the %'s?

image
image

Issue would still be the comparator you would end up with Character01 = “%something%”

Agh… right… possibly some dyslexia while reading the original.
On second read… this does look messy.

and interesting (to me)… a “begins” filter is ignored by a simple baq report I was screwing around with. Now I wonder if it’s ever worked on the is version.

Thank you for all the suggestions. I’m out due to covid. I will review all the info when I return to the office.

Thank you all for the suggestions. This appears to work.

1 Like