简体   繁体   中英

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)

在此处输入图片说明

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"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM