Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Is there any expression for selecting two columns and display it in a single column of report, if either of them is null?.

For example: In SQL I can use coalesce:

coalesce(column1,column2) -- which selects column1 when column2 is null and vice versa.

Is there any alternative for this, in SSRS, where I can select either column1 or column2 and display in a single field of my report ??

Please help.

Thanks,
DhivyaJ
Posted
Updated 15-Apr-13 20:03pm
v5
Comments
ZurdoDev 15-Apr-13 10:00am    
Can't you just do it in SQL?
Maciej Los 16-Apr-13 2:14am    
Good question! My virtual 5.
Dhivya.J 15-Apr-13 23:30pm    
Hi. I know this is possible in SQL and i want this to be handled in my report only.
Maciej Los 16-Apr-13 2:14am    
Why to torture yourself?
Dhivya.J 16-Apr-13 2:24am    
Hi Los. I am not torturing myself and right now I dont have rights to do this in SQL. That is why i wanna handle it in report.

1 solution

Try this:
right click the tablix column and select Expression.

C#
=Fields!FirstName.Value & IIF(Fields!FirstName.Value = "", "", "; ") &
 Fields!MidName.Value & IIF(Fields!MidName.Value = "", "", "; ") &
 Fields!LastName.Value & IIF( Fields!LastName.Value = "", "", "; ") &


to check is null or empty:
C#
IIF(Fields!NursingActionsClose.Value="","ifNulltakeThisPart","ifNOtNullTakeThisPart")
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900