Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Don't waste time waiting for inspiration. Begin, and inspiration will find you
 
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

Naveen

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

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.
3

jigish

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

uh

29
April
Thanks - helpful

MAKE A COMMENT

Name *

Email Address *

Comment *