-- 作者:fubblyc
-- 发布时间:2016/12/2 14:15:00
-- 跨表引用,引用的是当前行不同列的值
求助:跨表引用,引用的是当前行不同列的值
此主题相关图片如下:微信截图_20161202140348.png
此主题相关图片如下:微信截图_20161202141821.png
我如下做法,是不对的,得到上图错误的同期_同比提升值:
DataColChanged
If e.DataCol.Name = "指标项目" Then If e.NewValue Is Nothing Then e.DataRow("同期_同比提升") = Nothing Else Dim dr As Row = Tables("零售报表_table1").Current
For Each c As Col In Tables("零售报表_table1").Cols If c.name = "总销售金额stp" Or c.name = "VIP销售金额stp" Then If dr IsNot Nothing e.DataRow("同期_同比提升") = dr(c.name) End If End If Next End If End If
本期值我是用 横向转换过来的:
Dim zbs() As String = {"VIP销售金额","总销售金额"} Dim dr1 As Row = Tables("零售报表_table1").Current For Each zb As String In zbs Dim dr2 As DataRow = DataTables("竖向展示").AddNew() dr2("统计主体") = dr1("门店") dr2("指标项目") = zb dr2("本期值") = dr1(zb) Next
[此贴子已经被作者于2016/12/2 14:21:17编辑过]
|