Multiple Filters On Data Band

Stimulsoft Reports.NET discussion
Post Reply
Tom7
Posts: 21
Joined: Wed Mar 24, 2010 5:22 am
Location: Belfast

Multiple Filters On Data Band

Post by Tom7 »

Hi Everyone

Just wondering if it is possible to filter a data band with more than one statement block, I know you can add as many filters as you wish, as long as they all use the same operator, ie: AND / OR

So you can have, filter results on Databand.Column1 = "Test" AND Databand.Column2 = "Foo" AND Databand.Column3 = "Mars"

Same can be done with the OR, filter results on Databand.Column1 = "Test" OR Databand.Column1 = "Foo" OR Databand.Column1 = "Mars"

What I am wondering is can you combine the operators to produce something like:
(Databand.Column1 = "Test" OR Databand.Column1 = "Foo") AND Databand.Column3 = "Mars"

I cannot see a way of doing this is the data band filter, something like what is in the conditions wizard, where you have layered conditions allowing you to create the above scenario

anyone know if this can be done?

Cheers

Tom

Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Multiple Filters On Data Band

Post by Brendan »

It can be achieved using one filter, however you must write the expression in either C# or VB.NET code for it to work.

On the Filter window you change the dropdown for 'Field Is' to 'Expression'.
Then you can type your filter expression into the textbox.

So if it was C# you could use the following filter expression:

Code: Select all

(Databand.Column1 == "Test" || Databand.Column1 == "Foo") && Databand.Column3 == "Mars"
Tom7
Posts: 21
Joined: Wed Mar 24, 2010 5:22 am
Location: Belfast

Multiple Filters On Data Band

Post by Tom7 »

Thanks Brendan, much appreciated, I will give it a try

Tom
Post Reply