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

Report Filters Using OR

6 Answers 427 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rick Petersen
Top achievements
Rank 1
Rick Petersen asked on 15 Jun 2009, 08:14 PM
Looking for a way to do the following:

1 report parameter, DepartmentID we will call it.

I want a filter that says:

If RequestedDepartment = DepartmentID OR
AssignedDepartment = DepartmentID

I found an example in the forums where one of your techs said you could do:

=a = 10 Or b = 10    =true

but I tried apply that to my situation but it didn't work.  Maybe I mistyped something, but surely you guys have the 'OR' option in your filtering ... right?

6 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 16 Jun 2009, 08:27 AM
Hello Rick,

The reporting engine can calculate all logical operations internally, but we still lack the UI that enables the grouping of operands as the OR demands it. This is in our TODO list and would be taken care of for a subsequent version. The suggested approach from the thread you've found is applicable and it should work. Please check if you have applied the filter correctly i.e. the report parameters type is correct and the expression is properly validated.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rick Petersen
Top achievements
Rank 1
answered on 16 Jun 2009, 12:49 PM
Steve, thank you for your reply.

I didn't have confidence that it was going to work yesterday because I typed it in and immediately got an error complaining about the Or.  After reading your message I took a closer look at it, found out why it was complaining and fixed it... Seems to be working now.  Thank you very much; sorta wish I had looked into it more before.

Rick

0
Don
Top achievements
Rank 1
answered on 22 May 2013, 06:40 PM
This is from 2009 but I don't see a way to do this in the UI.

Could you provide a pointer to the specific syntax for creating an OR expression. 

Thanks,
Don Rule
0
Stef
Telerik team
answered on 27 May 2013, 08:51 AM
Hello Don,

You can use reverse Boolean logic and AND operator, or create a filter expression containing the whole comparison logic, e.g.:
 Telerik.Reporting.Filter filter1 = new Telerik.Reporting.Filter();
 filter1.Expression = "=Fields.MyFilterColumn like 'value1' OR Fields.MyFilterColumn like 'value2'";
 filter1.Operator = Telerik.Reporting.FilterOperator.Equal;
 filter1.Value = "=True";
  
 MyReport.Filters.Add(filter1);

I hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Don
Top achievements
Rank 1
answered on 30 May 2013, 01:59 AM
OK, more specifically how do i create an OR expression in the Report Designer?

Thanks,
Don Rule
0
Stef
Telerik team
answered on 03 Jun 2013, 02:46 PM
Hello Don,

You have to create a Boolean expression logic satisfying your requirements and then place it in the filters dialog "Expression". Please check the attached screenshot illustrating expression that will filter in only 'test1' and 'test2' values for the given Fields.HTML.

I hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Rick Petersen
Top achievements
Rank 1
Answers by
Steve
Telerik team
Rick Petersen
Top achievements
Rank 1
Don
Top achievements
Rank 1
Stef
Telerik team
Share this question
or