문제

I have a ReportViewer with LocalReport in an Asp.Net webform that currently has four placeholders, each containing a different field.

What I am looking to do is to change the placeholders from this:

[Name]
[Address1]
[Address2]
[CityStateZip]

To a more conditional display such as:

[Name]
[Address1]
if(Address2 != null)[Address2] else [CityStateZip]
if(Address2 != null)[CityStateZip] else ""

Is there a way I can do this in the rdlc?

도움이 되었습니까?

해결책

yes, you can do this with iif in RDLC expression. try this

=IIf(IsNothing(Fields!Address2.Value), Fields!Address2.Value, Fields!CityStateZip.Value)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top