如果值为空,如何隐藏/禁用行 [英] How to hide/disable a row if value is blank
问题描述
大家好,
我在Rdlc工作报告成功运行良好。
当我绑定数据有些客户没有城市,有些客户有价值。
我的意图是,如果有价值而不是没有问题,否则隐藏行。
ex:无地址
- -------
1地址1 //
//隐藏该行
city
country
2地址1
地址2
city
country
打印喜欢这个1地址1
city
国家
2地址1
地址2
city
country
hi all,
I working in Rdlc reports fine successfully running.
when I binding data some of customers have no city and some of customers have value.
my intention is if value is there than no problem otherwise hide the row.
ex: no address
-- -------
1 address1 //
//hide this row
city
country
2 address1
address2
city
country
print like this 1 address1
city
country
2 address1
address2
city
country
推荐答案
此解决方案将帮助您解决问题oblem
This Solution Will Help you to resolve your problem
For i As Integer = dt.Rows.Count - 1 To 0 Step -1
Dim row As DataRow = dt.Rows(i)
If row.Item(0) Is Nothing Then
dt.Rows.Remove(row)
ElseIf row.Item(0).ToString = "" Then
dt.Rows.Remove(row)
End If
Next
for RDLC你可以使用下面的方法..
在Classic客户端的工具菜单上,单击对象设计器。
在对象设计器中,单击报告,选择要修改的报表,然后单击设计。
在视图菜单上,单击布局。
在Visual Studio的Report.rdlc文件中,选择要有条件显示的控件或表格行。
在视图菜单上,单击属性窗口。
在属性窗口中,展开可见性。
在可见性下的隐藏字段中,选择< Expression ...>从下拉列表中。
在编辑表达式窗口中,输入隐藏控件或行的条件语句,然后单击确定。
下图在标准应用程序中显示报告2,General Journal - Test上的条件可见性表达式的示例。
如需更多帮助,可以在这里查看 http://msdn.microsoft.com/en-us/library/dd354976.aspx [ ^ ]
这篇关于如果值为空,如何隐藏/禁用行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!