zza
zza

Reputation: 1

ssrs iif expression reporting

I do not want to display ZDATEB(date) value when ZJNSBYR is blank(no value). Example of data as below:

ZJNSBYR ZDATEB
-----------------------
    20190728
    20190728

and ZDATEB(date) will be displayed as 28-08-2019 if there is value for ZJNSBYR

I have tried this :

iif(Fields!ZJNSBYR.Value=' ', Fields!ZDATEB.Value=' ',right(Fields!ZDATEB.Value, 2) & "-" & mid(Fields!ZDATEB.Value, 5, 2) & "-" & left(Fields!ZDATEB.Value, 4))

I follow this example:

IIF(Fields!ExitReason.Value = 7, 1, 0)

But got this error:

System.Web.Services.Protocols.SoapException: The Value expression for the textrun ‘ZDATEB5.Paragraphs[0].TextRuns[0]’ contains an error: [BC30201] Expression expected. at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.SetReportDefinition(String Report, Byte[] Definition, Warning[]& Warnings) at Microsoft.ReportingServices.WebServer.ReportingService2010Impl.SetItemDefinition(String ItemPath, Byte[] Definition, Property[] Properties, Warning[]& Warnings) at Microsoft.ReportingServices.WebServer.ReportingService2010.SetItemDefinition(String ItemPath, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

Upvotes: 0

Views: 45

Answers (1)

AnkUser
AnkUser

Reputation: 5531

enter image description here

This is your expected Result. How did I achieved it. Below is the expression.

Note: Your field name can vary depending on what you have in your Database.

=IIF(Isnothing(Fields!ZJNSBYR.Value) or Fields!ZJNSBYR.Value="" ,nothing,Format(Fields!ZDATEB.Value,"dd-MM-yyyy"))

Upvotes: 1

Related Questions