以下是用表达式列实现的,现在想改为代码:
iif([节点]='①审稿', Parent(jgrw).审稿,
iif([节点]='②组稿', Parent(jgrw).组稿,
null))
iif(Convert(SubString(Parent(gjrw).年级,1,1),'System.Single') > 6 and Parent(gjrw).科目='语文','文',
iif(Convert(SubString(Parent(gjrw).年级,1,1),'System.Single') > 6 and Parent(gjrw).科目='物理','理',
'小'))
iif([节点]='①审稿' and [分级] = '文', Parent(jgrw).编文 * Convert(SubString(Parent(jgrw).编效,1,2),'System.Single')/100,
iif([节点]='②组稿' and [分级] = '文', Parent(jgrw).编文 * Convert(SubString(Parent(jgrw).编效,3,2),'System.Single')/100,
null))
参考帮助文件中《跨表引用的自动更新》一节,有无关联的代码都试了,3个小时也没试出来。。。求助
If e.DataCol.Name = "产品编号" Then
If e.NewValue Is Nothing Then
e.DataRow("品名") = Nothing
e.DataRow("型号") = Nothing
e.DataRow("规格") = Nothing
e.DataRow("单价") = Nothing
Else
Dim dr As DataRow
dr = e.DataRow.GetParentRow("产品")
If dr IsNot Nothing
e.DataRow("品名") = dr("品名")
e.DataRow("型号") = dr("型号")
e.DataRow("规格") = dr("规格")
e.DataRow("单价") = dr("单价")
End If
End If
End If
有疑惑的是,=e.DataRow("列名") 之后,怎么对其数据如表达式列一样进行函数处理,比如:SubString(e.DataRow("品名") ,1,2)提示错误,不知道如果使用才是正确的,或者本身就不能用这个函数?
[此贴子已经被作者于2019/1/14 11:19:35编辑过]