简体   繁体   English

如何在rdlc报告中设置消息而不是空日期C#

[英]How to set message instead of empty date in rdlc report c#

i am using RDLC reports, i have date column which shows date when date is available in Sql table but when not then it shows empty but that looks abnormal, i want to show message like 'Date Not Available' when empty etc, i tried expression in rdlc but it only formats date not anything else. 我正在使用RDLC报告,我有日期列,当Sql表中的日期可用时显示日期,但当日期不可用时,它显示为空,但看起来异常,我想显示诸如“日期不可用”之类的消息,等时,我尝试了表达式在rdlc中,但仅格式化日期,没有其他内容。 Please help 请帮忙

=Format(Fields!DateReceived.Value, "dd/MMM/yyyy hh:mm")

您可以使用IsNothing ,例如:

=IIF(IsNothing(Fields!DateReceived.Value),"Date Not Available",Format(Fields!DateReceived.Value, "dd/MMM/yyyy hh:mm"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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