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

Need to build Filter Expressions based on 'OR'

2 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 14 Jan 2013, 05:53 PM
I'm currently using the below which adds Filters using AND, how could I use OR

foreach (string filter in _rptFilters)
    {
            Telerik.Reporting.Filter newfilter = new Telerik.Reporting.Filter();
            newfilter.Expression = "= StringToUpper(Fields." + filter + ")"  ;
 
            newfilter.Operator = Telerik.Reporting.FilterOperator.Equal;
            newfilter.Value = filter.Substring(filter.IndexOf("_") + 1).ToUpper();
 
            table1.Filters.Add(newfilter);
     }

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 15 Jan 2013, 04:24 PM
Hi Tim,

We currently lack OR logical operator. The workaround is to combine your statements to achieve the desired effect i.e. if you have the following formatting rule:

          Expression   Operator     Value
         ==========================
          =a                    =              =1
(Or)    =b                    =              =10

You can transform it like this:

              Expression          Operator     Value
         ==============================
          =a = 1 Or b = 10         =              =true

Hope this helps.

Regards,
Steve
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Tim
Top achievements
Rank 1
answered on 15 Jan 2013, 07:03 PM
got it working, thx

w00t!
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Steve
Telerik team
Tim
Top achievements
Rank 1
Share this question
or