user3309231
user3309231

Reputation: 196

RDLC Report hiding empty columns

I have a Tablix with a Column , i added this expression to show data in this column:

=Fields!PhoneNumber.Value & System.Environment.NewLine & Fields!Email.Value & System.Environment.NewLine & Fields!Address.Value

What i want is when one or more of the fields (PhoneNumber,Email,Address) is empty , the expression displays only non empty fields and does not put a new line

how to do this?

Upvotes: 0

Views: 342

Answers (1)

DRapp
DRapp

Reputation: 48139

why not throw-in IIF() to only add the new line IF a value is present

    =iif( string.IsNullOrWhiteSpace( Fields!PhoneNumber.Value ), '', Fields!PhoneNumber.Value & System.Environment.NewLine ) 
& iif( string.IsNullOrWhiteSpace( Fields!EMail.Value ), '', Fields!Email.Value & System.Environment.NewLine )  & Fields!Address.Value

Could get lengthy though.

Upvotes: 1

Related Questions