Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Ability is a poor man's wealth
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

14
February

How can I Add Multiple Conditions to the Visibility Property in SQL Reporting Services 2008?

During a recent SQL Server Reporting Services 2008 (SSRS 2008) report design project, a client asked   "How can I Add Multiple Conditions to the Visibility Property of a Report Item?"

If SSRS 2008 had the IN function then the formula would simply be:

=iif((Field_Type!Fieldname.Property) IN (Condition1, Condition2, Condition3), True, False)

However  SQL Server Reporting Services (SSRS) does not have an IN function within its   formula or expression functions, so to add multiple conditions, one would have to define each condition individually  and use the AND or OR functions between each condition.

Solution:

When creating conditional formatting formulas, with multiple conditions, one must enclose each condition within a bracket and then link them using either the AND or OR functions.

The syntax to control the visibility of a report item in SSRS 2008, with multiple conditins, is as follows:
= iif(((Field_Type!Fieldname.Property) = Condition1) OR
( Field_Type!Fieldname.Property = Condition2) OR
( Field_Type!Fieldname.Property = Condition3)) ,True , False)

Note: The default for the Visibility property for Report Items is Hidden

If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us




1

vishal

15
May
salary < 10,000 color red , salary 10,000 to 15,000 color green , salary > 15,000 color blue
2

Naveen

29
October
how to give iif condition in false part can any one help on this
3

Julia

05
November
Naveen, you would have to create a Nested IIf statement and add the condition to the false part of the statement above, but then make sure you state whether object is visible.
4

jigish

03
January
thank you it helped me a lot :)
5

uh

29
April
Thanks - helpful
6

Nazme Mahzabeen

11
December
I have a stacked column graph where I want to show total on top of each column(by using a work around). To show the total, some cases I need to add to rows (based on a condition). Can anyone help me how to put the condition. I can share more information if someone contacted me. Thanks in advance.

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

59 + 98 =