YAPS on Filters in an RDL: What's not to Like?

by Lisa Nicholls Tue, September 16 2008 20:38

Last week I wrote about my inability to use the "Like" filter on a table in an RDL.  I wasn't able to use "Like" and devised another solution that uses "Equals" instead.  I went on to show how you could make it more re-usable, etc, but asked whether readers had any ideas.

I'm happy to say that one of you did. Abdallah Elhawary wrote in to explain that the wildcard character is actually supposed to be a "*" rather than the standard SQL ones.  I'm still scratching my head over where this is written in the docs, because I swear I've looked.

At any rate it does work; you can do this successfully:

Like to Like

... so "Like" really does work.

Or... we could talk some more.

(That's a quote from Serenity -- I'm seriously behind quota. )

If you want to write something that ports to multiple reports more easily, and isolates the set of fields to be compared for each report table, you're still going to write a function something like what I showed in the other post.

What's more, it turns out that while my weird workaround provides a way to handle case-sensitivity in the comparison at the whim of the user, the Like filter is not going to give you the same ability. 

In fact, looks to me (not testing!) as though if the database does a case-insensitive comparison, that's what you get, and if the database is case-sensitive, that's what you get.

Since this probably means you're doing the filter before dragging the data, it's probably more performant (note again: I haven't tested this assumption about how it works!). So sometimes Like is just what the doctor ordered.

Other times, though... and here I'll quote from another great movie... you just gotta learn to be more flexible. When you're searching free-form text, the user wants to specify case-sensitivity, whole word only, etc.  And with just a little extra work, we can do those things.

Isn't it wonderful that we have both choices?

Thanks again to Abdallah; I have always been a believer in Love but he has restored my faith in Like.

Tags:

Reporting | SQL Server | YAPS

Comments (4) -

12/15/2008 8:55:46 PM #

wisdom

good. Learn something from these two articles.

thanks.

W
-----------
Side talk, why i can't find China in the country List, when i am adding a comment?

wisdom

12/17/2008 12:00:37 PM #

>L<

I don't know, W, but I'll try to find out!  Thanks for letting me know...

>L< United States

12/18/2008 4:33:06 PM #

&gt;L&lt;

OK -- the answer to Wisdom's question is that China really is on the list, using the English name of his country, which is People's Republic of China, not China.  But, because this is an interesting cultural question as well as a code question, I may follow this up with another blog post on the subject... Thanks, W!

>L< United States

12/22/2009 2:00:25 PM #

dentist hungary

It's not too easy to understand. Lisa u r a hero!

dentist hungary Hungary

Pingbacks and trackbacks (1)+