如何在rdlc报告中显示空值? [英] How to show a null value in rdlc report?

查看:108
本文介绍了如何在rdlc报告中显示空值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份rdlc报告。并且Iam试图显示字段序列号Itm_description可用列.....如果字段itm_description为null,则序列号必须为null ...是否可能?



当我为Sl_No列表达式提供以下命令时,

Hi, I have a rdlc report. And Iam trying to show the Serial No. for the field Itm_description is available column.....If the field itm_description is null, then the serial no has to be null... Is it possible?

When I give the below command for Sl_No column expression,

IIf((Fields!itm_description.Value.ToString().Trim().Length=0), "",RowNumber(nothing))

IIf((Fields!itm_description.Value.ToString().Trim().Length=0), Nothing,RowNumber(nothing))

Output
======
1
2
3
4
#error
#error
#error



那么如何解决这个错误...


So how to solve this error...

推荐答案

我相信使用IsNothing f你需要使用的是什么。它可以测试NULL。



参见 http://social.msdn.microsoft.com/Forums/en-US/cbed4e88-16d4-4d4b-821a -7a7e728c7e34 / testing-for-null-in-rdlc-report-field?forum = vsreportcontrols [ ^ ]
I believe using the IsNothing function is what you'll need to use. It can test for NULL.

See http://social.msdn.microsoft.com/Forums/en-US/cbed4e88-16d4-4d4b-821a-7a7e728c7e34/testing-for-null-in-rdlc-report-field?forum=vsreportcontrols[^]


从你的提示,我成功通过以下表达式

From your tips, I succeeded by the following expression
=IIf((Convert.ToString(Fields!itm_description.Value).Trim().Length=0), "", RowNumber(nothing))



谢谢


Thanks


这篇关于如何在rdlc报告中显示空值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆